in this article, we'll learn how to use startswith() in python.

example 1

in this example, we'll check if the string starts with character "python"


#string
string = "python is a language programming"

if string.startswith("p"):
    print("yes")    

output

yes

example 2

in this example we'll check if string start with character "python"


#string
string = "python is a language programming"

if string.startswith('python'):
    print("yes! the string starts with python word")

output

yes! the string starts with python word

English today is not an art to be mastered it's just a tool to use to get a result