Question: 1- Write a program that computes the sum of the odd numbers and even numbers between a and b (both are included) inputted by

1- Write a program that computes the sum of the odd numbers

 

1- Write a program that computes the sum of the odd numbers and even numbers between a and b (both are included) inputted by the user and returns the results. For this, the function sum_number() receives "a" and "b", and returns sum of odd numbers and even numbers to the main body. Sample Run: Enter the starting number: 3 Enter the ending number: 10 The odd numbers: [3, 5, 7, 9] The even numbers: [4, 6, 8, 10] Sum of odd numbers between 3 and 10: 24 Sum of even numbers between 3 and 10: 28

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!