TIL In python you can pass a tuple to `str.startswith`
Pythonβs str.startswith can take a tuple as an argument, and will return True if any element matches.
txt = "Hi, welcome to my world."
x = txt.startswith(("Hello", "Hi"))
print(x) # True
Pythonβs str.startswith can take a tuple as an argument, and will return True if any element matches.
txt = "Hi, welcome to my world."
x = txt.startswith(("Hello", "Hi"))
print(x) # True