Question: Write a program that receives a list of numbers from the user ( keyboard ) and print the sum of odd numbers. For example, if
Write a program that receives a list of numbers
from the user keyboard and print the sum of
odd numbers. For example, if the user enters
the program should print the sum of
and which is
If the user enters x the loop will exit.
As long as the user does not enter x your program
Ans: while True:
UserinputEnter a number or enter x to quit:"
if Userx:
break
printQuit Program"
elif oddSum
for i in rangeendPoint:
oddSum i
printsum of odd numbers from to strendPoint is stroddSum
should keep receiving numbers.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
