Answer to Question #291230 in Python for H A

Question #291230
input 5 numbers and calculate sum of the even number

I want very simple code



1
Expert's answer
2022-01-27T09:54:44-0500
maximum = int(input(" Enter total numbers that you want to sum : "))
total = 0

for number in range(1, maximum+1):
    if(number % 2 == 0):
        print("{0}".format(number))
        total = total + number

print("The Sum of Even Numbers from 1 to {0} = {1}".format(number, total))

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS