Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to check all the elements in a list are even or not

num = [2, 2, 2, 2]
res = all([i % 2 == 0 for i in num])
print(res)
 
PREVIOUS NEXT
Tagged: #check #elements #list
ADD COMMENT
Topic
Name
2+3 =