In <[email protected]> [email protected]
writes:
> Okay, thank you very much for the timely replies, heres what i have now:
> title = "Guess my number game:"
> print title.title()
> raw_input("Press any key to continue..")
> import random
> number = random.randrange(99) + 1
> tries = 0
> guess = int(raw_input("Guess my number! Secret - It is between 1 and 100 :"))
> while (guess != number):
> if (guess > number):
> number = int(raw_input("Sorry, my number is lower than that! \n Try
> again:"))
> tries += 1
> else:
> number = int(raw_input("Sorry, my number is higher than that! \n Try
> again:"))
> tries += 1
>
> print "good job, you won!"
>
> raw_input("\n\n Press any key to exit..")
> ## it seems to stick with "higher" or "lower" after my first guess, whichever
> it
> ## is
When the user re-enters their guess in the while loop, you're assigning
the input to "number" instead of "guess".
--
John Gordon A is for Amy, who fell down the stairs
[email protected] B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
http://mail.python.org/mailman/listinfo/python-list