[Tutor] while loop problem

Alan Gauld alan.gauld at btinternet.com
Sun Mar 8 19:16:15 CET 2009


"mustafa akkoc" <mustafa.cmpe at gmail.com> wrote

> hello i have syntax problem in this program
> #!/usr/bin/python
> # Filename: while.py
> number = 23
> running = True
>
> while running :
> guess= input('Enter an integer : ')  # it give a syntax error this 
> line can
> you me ?

Always post the full text of error messages please. It helps us a lot.

Howevbder in this case I suspect the problem is that you do not
seem to have indented the line under the while loop (although that
may be due to email reformatting issues...) But that should say
IndentationError not Syntax error?

Also you don;t say what version of Python you are using.
input() has changed slightly in v3...

HTH,

Alan G. 




More information about the Tutor mailing list