Question: Write the Python program for each of the following question using only one while loop. 1-Find the sum of the even and odd numbers from

Write the Python program for each of the following question using only one while loop.

1-Find the sum of the even and odd numbers from 1 to n. n is input from the user.

2-Save a integer number between 1 and 100 in a variable, then let the user guess this number. The user has only 5 chances to find the number. If the user finds the number within 5 trials, then print You won the game., otherwise print You lost the game..

3-Find the factorial of a number that is input by the user. Assume that the user inputs a number that is less than or equal to 10.

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!