Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python check if item in 2d list

mylist = [[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]]
print(any(6 in sublist for sublist in mylist))
# True
 
PREVIOUS NEXT
Tagged: #python #check #item #list
ADD COMMENT
Topic
Name
5+1 =