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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started