startswith multiple arguments python 1

startswith multiple arguments python

if str.lower().startswith(("js", "catalog", "script", "katalog")): #examples

Here is what the above code is Doing:
1. It’s checking if the string starts with any of the words in the tuple.
2. If it does, it returns True.
3. If it doesn’t, it returns False.

Similar Posts