I want to check if zero is in this list of lists. For example:
lst = [[2,2,2],[2,2,0],[2,2,2],[2,2,2]]
If lists in 'lst' contains "0", then print("Yes")
, else print("No")
. The above list should give the result of "Yes", since lst[1][2] == 0
.
Here is my code, but it doesn't work:
if (0 in (lst[x] for x in range(len(lst)))):
print("Yes")
else:
print("No")