Source Code:
(back to article)
my_list = ["apple", "banana", "cherry"] if any(x == "banana" for x in my_list): print("banana is in the list") else: print("banana is not in the list")
Result:
Report an issue