I'm trying to make a function that makes sure that my tuple is only made up of zeros or ones.
def zero_um(maze):
for i in range(len(maze)):
if maze[i]==0 and maze[i]==1:
return True
else:
return False
However this will always lead to false because a numer can't be one and zero at the same time. But if i try:
def zero_um(tpl):
for i in range(len(tpl)):
if tpl[i]==0 or tpl[i]==1:
return True
else:
return False
but that accepts asnwers like (1,2) I've also tried with using != but ran into similar dilemas