input 5 numbers and calculate sum of the even number
I want very simple code
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))
Comments
Leave a comment