python test if value in list 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: check if a number is in a list python
5 in [3, 4, 5, 6, 7]
# True
9 in [3, 4, 5, 6, 7]
# False
y = any(x in String for x in List)
5 in [3, 4, 5, 6, 7]
# True
9 in [3, 4, 5, 6, 7]
# False