Question: Write an Python function called loops that takes no parameters and returns Nothing. The function begins by asking the user to enter two positive integers

Write an Python function called loops that takes no parameters and returns Nothing. The function begins by asking the user to enter two positive integers that you assign to two variables n and p respectively.
The program (function) must then contain:
- a loop displaying and incrementing the value of n as long as it remains less than
that of p.
- a 2nd other loop (independent of the 1st) decreasing the value of p and
displaying its value if it is odd. Loop as long as p is not zero.

Step by Step Solution

3.53 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres a Python function called loops that follows the described behavior pyth... View full answer

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!