if string is first string in a list python code example
Example 1: check if anything in a list is in a string python
y = any(x in String for x in List)
Example 2: print first word of a string python and return it
def print_first_word():
words = "All good things come to those who wait"
print(words.split().pop(0))
#to print the last word use pop(-1)
print_first_word()
Example 3: if list item in string python
if any(ext in url_string for ext in extensionsToCheck):
print(url_string)