Sprawdź, czy coś na liście znajduje się w Pythonie sznurkowym
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)
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
isinstance(some_object, str)