#startswith():检查字符串是否以某个子串开头,是返回true,不是返回false,如果设定了开始和结束下标,则在指定范围内寻找
#startswith(str,starts,ends)
str = 'apple is a blue apple'
print(str.startswith('apple'))
print(str.startswith('is', 2, 10))
#endswith()以某个子串结尾
print(str.endswith('e'))
True
False
True