Wenn Sie Element in String Python auflisten
if any(ext in url_string for ext in extensionsToCheck):
print(url_string)
Cook's Tree Boa
if any(ext in url_string for ext in extensionsToCheck):
print(url_string)
if item in my_list:
# whatever
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"]'!
list1 = ["a", "b", "c"]
isBInList = "b" in list1 # True