Error invalid syntax while statement

Chris Rebert clp2 at rebertia.com
Sat Jan 8 00:28:19 EST 2011


On Fri, Jan 7, 2011 at 9:18 PM, Garland Fulton <stackslip at gmail.com> wrote:
> I don't understand what I'm doing wrong i've tried several different cases
> for what i am doing here. Will someone please point my error out.
> Thank you.
>
>   1 #!/bin/bash/python

This shebang undoubtedly erroneous.

>   5     if( 0 > x | x > 2147483647):

One normally writes that using boolean "or" rather than the bitwise
operator. Also, the parentheses are completely unnecessary visual
clutter.

>  15         print("counter: ", counter

Where's the closing parenthesis?

>  17               while (end == 0):                              #
> <-------------------returns syntax error on this while statement

Always include the exact error message + traceback in the future.

Cheers,
Chris
--
http://blog.rebertia.com



More information about the Python-list mailing list