Skip to content

Instantly share code, notes, and snippets.

@msert29
Created September 14, 2016 10:40
Show Gist options
  • Save msert29/23cfae2abc4d71a3cb5922b2a751e190 to your computer and use it in GitHub Desktop.
Save msert29/23cfae2abc4d71a3cb5922b2a751e190 to your computer and use it in GitHub Desktop.
hotjar challange
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