My code is about Guessing Random Number in Python. It gives five chances to guess the number correctly
This is the Random Number Guessing game in Python. First of all by default the code contains some random number from 1 to 100, because I have used random.randint(). so this generates a random number. Now the game begins.. We have to guess the generated random number correctly in 5 chances. this code generates until we guess the number correctly because we used While loop but for only 5 chances. To predict the number in 5 chances I have used two statements, they are "too high" and "too low". If we guess the number below the random number means it gives a statement "too low" , our guess above means it gives "too high". so that we can guess the number correctly in 5 guesses. If we didnt guess the number correctly in 5 guesses means it gives a statement that "your chances are over" and prints the generated randoom number too. This is about the game
Submitted by SWATHI PRIYA DODDI (Swathipriya)
Download packets of source code on Coders Packet
Comments