Cheesywillie
Programmer
I am a Web designer but i am learning python. I am reading a tutorial and I came to the guess the number seciton could some1 answer me 2 questions about the game code:
How do i get a random Number to be generated?
How do i get the game to end after 20 guesses?
Here is my code thus far:
number = 78
guess = 0
while guess != number :
guess = input ("Guess a number: ")
if guess > number :
print "Too high"
elif guess < number :
print "Too low"
print "Just right"
Thanx for any Help
How do i get a random Number to be generated?
How do i get the game to end after 20 guesses?
Here is my code thus far:
number = 78
guess = 0
while guess != number :
guess = input ("Guess a number: ")
if guess > number :
print "Too high"
elif guess < number :
print "Too low"
print "Just right"
Thanx for any Help