check if a string is prefix of another string python code example
Example 1: python startswith
text = "Python is easy to learn."
result = text.startswith('is easy')
# returns False
print(result)
result = text.startswith('Python is ')
# returns True
print(result)
result = text.startswith('Python is easy to learn.')
# returns True
print(result)
Example 2: python startswith
str.startswith(prefix[, start[, end]])