menu search
brightness_auto
more_vert
3 1

Write a program to display sum of odd numbers and even numbers that fall between 12 and 37(including both numbers)

Topic Python Programming
Type Python Program
Class 10
thumb_up_off_alt 3 like thumb_down_off_alt 0 dislike

1 Answer

more_vert
0

# Python Program to find Sum of Even and Odd Numbers from 12 to 37

minimum = int(input(" Please Enter the Minimum Value : ")) 

maximum = int(input(" Please Enter the Maximum Value : "))

even_total = 0

odd_total = 0

for number in range(minimum, maximum + 1):

     if(number % 2 == 0):

        even_total = even_total + number

else:

        odd_total = odd_total + number

print("The Sum of Even Numbers from 12 to 37 = {1}".format(number, even_total))

print("The Sum of Odd Numbers from 12 to 37 = {1}".format(number, odd_total))


Study more about Python at Python Class 10

thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike

Related questions

thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 4 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 3 like thumb_down_off_alt 0 dislike
0 answers
thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 3 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 3 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 3 like thumb_down_off_alt 0 dislike
0 answers
thumb_up_off_alt 3 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 3 like thumb_down_off_alt 0 dislike
1 answer
...