On Fri, May 3, 2013 at 7:18 PM,  <ryankoc...@gmail.com> wrote:
> title = "Guess my number game:"
> print title.title()
> raw_input("Press any key to continue..")
>
> import random
>
> tries = 0
> number = random.randrange(99) + 1
> 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 if (guess < number):
>     number = int(raw_input("Sorry, my number is higher than that! \n Try 
> again:")
>     tries += 1
> print "Congratulations, you guessed my number! \n And it only took you" tries 
> "tries!"
>
> raw_input("\n\n Press any key to exit..")
>
> ## what is wrong with this script? I'm just trying to understand while loops 
> and ## this is not a real project :P
> --
> http://mail.python.org/mailman/listinfo/python-list

1. post full tracebacks.
2. The contents of your while loop must be indented, just like the
contents of the if/else if statement you have there.  So, four spaces
before the 'if', 'else if' and 'print' lines; eight before 'number'
and 'tries' lines.

--
Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16
stop html mail                | always bottom-post
http://asciiribbon.org        | http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to