1text = "Python is easy to learn."
2
3result = text.startswith('is easy')
4# returns False
5print(result)
6
7result = text.startswith('Python is ')
8# returns True
9print(result)
10
11result = text.startswith('Python is easy to learn.')
12# returns True
13print(result)
1# str -> the prefix you are looking for
2# beg -> where to start looking for the prefix
3# end -> where to stop looking for the prefix
4
5str.startswith(str, beg=0,end=len(string))