Question: Write a simple program: We want to create a program that reads integer values and displays the average of those that are even, and those
Write a simple program:


We want to create a program that reads integer values and displays the average of those that are even, and those that are odd. The program should accepts input values until the user enters 999. We have the following fill-in template: print("This program calculates the average of even and odd numbers.") # Initialize accumulators and counters total_even = total_odd = count_even = count_odd = # Process input values )) while ...if % 2 == 0: ....total_even += ...count_even += ....else: ...total_odd += ..count_odd += )) ..count_odd += )) # Calculate averages if > ....print("Average of even numbers is", else: ....print("No even numbers input.") if ) ....print("Average of odd numbers is", else: ....print("No odd numbers input.") From the group of expressions below, drag into the appropriate places above the blocks needed to complete the program. avg_odd total_odd input int count_even x 1 count_odd -1 avg_even 0 999 "Enter nro.." total_even
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
