I am trying to write a script for class for a game called guess the number.
I’m almost done but, I’m having a hard time getting the hints to print
correctly. I’ve tried ‘if’’ ‘elif’ nested, it seems like everything….I’m
posting my code for the hints below, any help is greatly appreciated!
def print_hints(secret, guess):
if guess < 1 or guess > 101:
print
print "Out of range!"
print
if guess < secret:
print
print "Too low!"
elif guess < (secret - 10) or guess > (secret - 10):
print "You are cold!"
print
print "Please play again!"
elif guess < (secret - 5) or guess > (secret - 5):
print "You are warmer!"
print
else:
print "You're on fire!!"
if guess > secret:
print
print "Too high!"
print
elif guess < (secret - 10) or guess > (secret - 10):
print "You are cold!"
print
elif guess < (secret - 5)or guess > (secret - 5):
print "You are warmer!"
print
print "Please play again!"
else:
print "You're on fire!!"
Thanks again!!
Scott
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor