I'm trying to write a function that takes in a list and returns true if it contains the numbers 0,0,7 in that order. When I run this code:
def prob11(abc):
if 7 and 0 and 0 not in abc:
return False
x = abc.index(0)
elif 7 and 0 and 0 in abc and abc[x + 1] == 0 and abc[x + 2] == 7:
return True
else:
return False
I get this error:
File "<ipython-input-12-e2879221a9bf>", line 5
elif 7 and 0 and 0 in abc and abc[x + 1] == 0 and abc[x + 2] == 7:
^
SyntaxError: invalid syntax
Whats wrong with my elif statement?