Here's my code:
mylist = [1, 1, 0, 0, 0, 0, 0, 0, 0]
def myfunction(mylist):
for val in mylist:
if val != 0:
return False
else:
return True
print(myfunction(mylist))
What return I'm expecting: True
What it gives me: False
My intentions: I want to check if there are any 0 in my list.
If there is atleast one 0 in my list, return True.