Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is the question: Write 3 functions list input(), even sum() and odd sum(). list input() should get a list of numbers from user while

This is the question:

Write 3 functions listinput(), evensum() and oddsum(). listinput() should get a list of numbers from user while evensum should return the sum of all the even numbers in the given list, and oddsum should return the sum of all the odd numbers in the given list.

This is my code:

input=[] even_Sum = 0 odd_Sum = 0 for number in input: if(number % 2 == 0): even_Sum = even_Sum + number else: odd_Sum = odd_Sum + number print("Sum of Even Numbers: {0},".format(even_Sum),'',end='') print("Sum of Odd Numbers: {0}".format(odd_Sum))

Can you help me to fix my code so that it can receive any input from the program? Input example are 99, 99, 99, 99, 99, 99, 99, 99, 99, 99. In python pls

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

U11 Informing Industry: Publicizing Contract Actions 317

Answered: 1 week ago

Question

explain the need for human resource strategies in organisations

Answered: 1 week ago

Question

describe the stages involved in human resource planning

Answered: 1 week ago