64,127 views
42 votes
42 votes
How would i do this in python?

Create a program called Lab3B1 that will do the following
• Ask the user to enter an unknown set of integers, and stop when they enter 9999
• Add up all the even numbers.
• After the loop, print the sum of the even numbers with a label.




--------------
This is what I have so far:

data = input("Enter a number or enter 9999 to stop: ")
total=0
while data != "":
number=int(data)
total+= number
data=input("Enter a number or enter 9999 to stop: ")

if data == '9999':
break

User Derek Lakin
by
2.5k points

1 Answer

15 votes
15 votes

Answer: following instructions

Explanation: thats how you figure things out

User Shing
by
2.6k points