. Advertisement .
..3..
. Advertisement .
..4..
Python is new to me. Today, I want to learn more about “check if a string contains an element from a list in python”. Can you share with me some experiences or examples here?
Here is a case study for you# To check if a certain element is contained in a list use 'in'
bikes = ['trek', 'redline', 'giant']
'trek' in bikes
# Output:
# True
I recommend the following method would help