Topic : Iteration/Looping
#1Calculate the Factorial of a Number
Write a program that can ind the factorial of any given number. For
example, ind the factorial of the number 5 (often written as 5!) which
is 1 * 2 * 3 * 4 * 5 and equals 120.
The factorial is not de ined for negative numbers and the factorial of
Zero is 1; that is 0! = 1.
Your program should take as input an integer from the user
#2 Print All the Prime Numbers in a Range
#3 Number guessing game
The program randomly selects a number between 1 and 10.
It will then ask the player to enter their guess.
It will then check to see if that number is the same as the one the
computer randomly generated; if it is then the player has won.
If the player’s guess is not the same, then it will check to see if the number is higher or
lower than the guess and tell the player.
The player will have 4 goes to guess the number correctly; if they don’t guess the number
within this number of attempts, then they will be informed that they have lost the game
and will be told what the actual number was.
Finally you may add the following additional features
1.Provide a cheat mode, for example if the user enters −1 print out
the number they need to guess and then loop again. This does not
count as one of their goes.
2.If their guess is within 1 of the actual number tell the player this.
3.At the end of the game, before printing 'Game Over', modify your
program so that it asks the user if they want to play again; if they
say yes then restart the whole thing.
#4 Rolling Dice game : Write a python program to design a rolling dice game, In this game we
will continue to roll a pair of dice until the user indicates that they do not want to roll again.