logo CodeStepByStep logo

even_average

Language/Type: Python basics user input

Write a Python program that prompts the user for nonzero integers, and then prints the average of all even numbers typed. (When the user types 0, stop asking for input.) You may assume that the user types at least one even integer. The following is an example output from one run of your code:

Integer? 1
Integer? 3
Integer? 2
Integer? 6
Integer? 4
Integer? 10
Integer? 9
Integer? 0
Average: 5.5
Complete program: Write an entire program that you could put into a file and run outside of CodeStepByStep.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.