Advertisement
here2share

# any_in_list_bool.py

Sep 8th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.15 KB | None | 0 0
  1. # any_in_list_bool.py
  2.  
  3. a = ['a', 'b', 'c', '123']
  4. str = "xyz123.py"
  5. print any(x in str for x in a)
  6. str = "xyz.py"
  7. print any(x in str for x in a)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement