[Tutor] assigning a variable a value
Andre Engels
andreengels at gmail.com
Thu May 5 09:54:17 CEST 2011
On Thu, May 5, 2011 at 2:19 AM, Kyle Benak <kbenak86 at yahoo.com> wrote:
> I am learning python and I am trying to write a simple "guess the number"
> game. I wrote the program in the IDLE, and I set the variable tries=1 to
> keep up with the number of tries it takes to guess the number, but when I
> try to run the program it gives the error message "improper syntax" and
> highlights the word tries. So, I assigned the variable tries the value 1 in
> the python shell window and it works fine there. Can you tell me why it
> won't work in the program? A copy of my code is below for clarification.
If the parser tells you there's a syntax error, it is often in the
line it shows, but also often in the line preceding that. In this
case, it is the latter: You have two opening brackets there, but only
one closing bracket.
--
André Engels, andreengels at gmail.com
More information about the Tutor
mailing list