# Véletlen
import random
#1 től 99 9ig
number = random.randint(1, 99)
#kezdőérték
guesses = 0
#feltétel
while guesses < 5:
guess = int(raw_input("Enter an integer from 1 to 99: "))
guesses +=1
print "this is your %d guess" %guesses
#írja ki hányadik
if guess < number:
print "guess is low"
elif guess > number:
print "guess is high"
elif guess == number:
break
if guess == number:
guesses = str(guesses)
print "You guess it in : ", guesses + " guesses"
if guess != number:
number = str(number)
print "The secret number was", number
import random
#1 től 99 9ig
number = random.randint(1, 99)
#kezdőérték
guesses = 0
#feltétel
while guesses < 5:
guess = int(raw_input("Enter an integer from 1 to 99: "))
guesses +=1
print "this is your %d guess" %guesses
#írja ki hányadik
if guess < number:
print "guess is low"
elif guess > number:
print "guess is high"
elif guess == number:
break
if guess == number:
guesses = str(guesses)
print "You guess it in : ", guesses + " guesses"
if guess != number:
number = str(number)
print "The secret number was", number
Nincsenek megjegyzések:
Megjegyzés küldése