Compruebe si algo en una lista está en una cadena de pitón
y = any(x in String for x in List)
itsanantk
y = any(x in String for x in List)
if any(ext in url_string for ext in extensionsToCheck):
print(url_string)
# To check if a certain element is contained in a list use 'in'
bikes = ['trek', 'redline', 'giant']
'trek' in bikes
# Output:
# True
if item in my_list:
# whatever
if value in list:
#do stuff
#Also to check if it doesn't contain
if value not in list:
#do stuff
string = "hello"
list = ["bye", "kasd", "hello", "day", "hel"]
if string in list:
print(f"Found '{string}' in '{list}'!")
else:
print(f"Couldnt find '{string}' in '{list}'!")
>>> Found 'hello' in '["bye", "kasd", "hello", "day", "hel"]'!