Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python, find out that a list does not have specific item

Let's say there is a list a that contains both numbers and letters. Is there quick way to find out that the list doesn't contain some specific element. I plan to use it in conditions.

like image 856
Maks Avatar asked Dec 15 '10 14:12

Maks


1 Answers

Maybe

3 not in [1, 2, "a"]
# True
like image 198
Sven Marnach Avatar answered Sep 25 '22 10:09

Sven Marnach