1、打开JUPYTER NOTEBOOK,新建一个PY文档。

3、"You are the king.".startswith("you")但是注意大写小写,因为大写和小写会被判定为不一样。

5、"123321 is number".startswith("123")除了字母以外,字符串里的数字也是可以判断的。

7、"You are the king.".endswith("king.")除了判断前面,endswith则是判断后面的部分。

9、"You are the king.".endswith("king")但是要非常小心一个句子里面是否有句号逗号等。

11、"You are the king.".startswith("are", 0, 10)"You are the king.".startswith("are", 4, 10)也可以用范围来进行判断,但是起点一定要是一样的。
