Question: I have to write Python program that takes a list of integers as input, [3,8,5,1,4,9,2,10,7] and using for loop find out sum of odd numbers,

  1. I have to write Python program that takes a list of integers as input, [3,8,5,1,4,9,2,10,7] and using "for" loop find out sum of odd numbers, sum of even numbers, largest number and smallest number in the list.  You need to provide this list to your program, your program doesn't need to take the list from user.
  2. Make sure your program will produce correct output.

Use "for" loop to calculate.  have not to use"while" loop    

 

Use only one loop for do all calculation, multiple loops are not allowed.

 

Use of "Min" or "Max" is not allowed.

output must be exactly same as:

 

Sum of even numbers is:   24
Sum of odd numbers is:    25
Largest number in the list is:   10
Smallest number in the list is:   1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Input List numbers 3 8 5 1 4 9 2 10 7 Initialize variables to keep track of ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!