Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sum_of_odd = 0
- counter = 0
- while True:
- command = input("Enter a number or type 'END' to finish: ")
- if command == "END":
- print(sum_of_odd)
- break
- command = int(command)
- if counter <= 5:
- if command % 2 != 0:
- sum_of_odd += command
- counter += 1
- elif command == "END":
- print(sum_of_odd)
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement