Created
September 14, 2016 10:40
-
-
Save msert29/23cfae2abc4d71a3cb5922b2a751e190 to your computer and use it in GitHub Desktop.
hotjar challange
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
l = [0,1,2,4] # can change the list | |
def check_seq(liste): | |
liste = iter(liste) | |
if (1 in liste): #Check if first sequence item is in list and start iterating when we have a match | |
if liste.__next__() == 2: # check next item | |
if liste.__next__() == 4: # check next item | |
return True # sequence found | |
else: | |
return False | |
else: | |
return False | |
else: | |
return False | |
condition = check_seq(l) | |
print (condition) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment