What is the output of print('Python'.startswith('Py')) in Python?
print('Python'.startswith('Py'))
Correct answer
C. True
12 views
C. True
12 views
startswith() checks whether the string begins with the given prefix.
Asked in: Python Interview Strings
https://docs.python.org/3/library/stdtypes.html#string-methodsNot sure why the answer is C? Ask here and get an explanation.