Question: Write a Python program that uses functions , while or for loops to perform the following steps : - Prompts the user to enter two

Write a Python program that uses functions , while or for loops to
perform the following steps :-
Prompts the user to enter two positive integers that are greater than
one. The user enters firstNum followed by a secondNum ( firstNum
must be less than secondNum and it must be >1). The program then
will do the following :-
1. Display all even numbers between firstNum and secondNum.
2. Display all odd numbers between firstNum and secondNum.
3. Display the sum of all even numbers between firstNum and
secondNum.
4. Display the sum of all odd numbers between firstNum and
secondNum.
5. Display a message indicating whether the first number and the
second number are prime numbers.
6. Display the numbers and their squares between firstNum and
secondNum.
Note: The first number and the second number are included and are
part of the calculations
Must use at least 6 functions for the above operation

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 Programming Questions!