Created
August 6, 2018 20:05
-
-
Save solen003/d5a228c7999a3054e66a3df55e21a548 to your computer and use it in GitHub Desktop.
summer_69
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
def summer_69(mylist): | |
total = 0 | |
add_on = True | |
for i in mylist: | |
if i == 9 and add_on == False: | |
add_on = True | |
elif i == 6: | |
add_on = False | |
elif add_on == True and i != 6: | |
total += i | |
print(total) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment