1 Question Write Python Program Use Else Condition Statement Calculate Sum Evennumbers Ave Q37259417

1. Question: Write a Python program to use if-elsecondition statement to calculate the SUM ofevennumbers, and the AVERAGE of oddnumbers, and these numbers are from USERS’ INPUT (fromuser’s input one by one, until reach a definite number of inputs asuser decided).

2. Hint 1: if-else condition: See Zelle’s textbook Page 234,average1.py, view from Chromehttps://mcsp.wartburg.edu/zelle/python/ppics2/code/chapter08/average1.py

# average1.pydef main(): n = eval(input(“How many numbers do you have? “)) sum = 0.0 for i in range(n): x = eval(input(“Enter a number >> “))

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.