-
-
Save codecademydev/f017a40ff8df1a0432681a122db5f587 to your computer and use it in GitHub Desktop.
Codecademy export
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
#Write your function here | |
def over_nine_thousand(lst): | |
sum1 = 0 | |
for i in lst: | |
sum1 += i | |
while sum1 > 9000: | |
break | |
return sum1 | |
if sum1<= 9000: | |
return sum1 | |
while len(lst)==0: | |
break | |
return 0 | |
#Uncomment the line below when your function is done | |
print(over_nine_thousand([8000, 900, 120, 5000])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment