import random
secret = random.randint(1,100)
guess = 0
tries = 0
print( "AHOY! I'm the dread Pirate roberts, and I have a secret!")
print("It is a number from 1 to 99. I'll give you 6 tries.")
while guess !=secret and tries < 6:
guess = int(input("what's yer guess?"))if guess < secret:
print ("too low")
elif guess > secret:
print("too high")
tries=tries+1
if guess == secret:
print("down!")else: print("no more") print("the secret was",secret)相关分类