r/pythontips • u/KDLadia • Sep 26 '24
Syntax Help with code
Im trying to make a code that will have the user enter a random set of integers and add the even numbers but if "9999" is entered it will give the sum of all the given even numbers given. Whats wrong with my code? Here
6
Upvotes
View all comments
Show parent comment
2
u/GrahaamH Sep 26 '24
No problem instead of using float use int it'll make this process a ton easier. Then for elif change it to else or add a condition ie. else: or elif(data != 9999):