Q. Which method checks if a string starts with a prefix?

A
startswith()
B
begins()
C
prefix()
D
start()
Solution:

startswith() checks if a string begins with a specified prefix, e.g., ‘Python’.startswith(‘Py’) is True.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!