How to compare a string to all values in a list in Python

Comparing a string to all values in a list asserts whether the string is present in the list.

Solution for How to compare a string to all values in a list in Python : You can use in to compare a string to all values in a list Use the syntax str in list to return True if str is in list and False if otherwise.


how-to-compare-a-string-to-all-values-in-a-list-in-python