[Solved] My variable keeps getting a syntax error. What should i do [closed]


$ python test.py
  File "test.py", line 11
    While not x==0:
              ^
SyntaxError: invalid syntax

This is a bug in Python. The caret should be pointing to the capital ‘W’ in ‘While’. You must spell ‘while’ with all lowercase letters.

You have some other typos as well:

   File "test.py", line 17
    for divisor in the range (2,PrimeNo-1):
                           ^
SyntaxError: invalid syntax

Here the caret should point at the ‘the’, which should just be removed.

  File "test.py", line 18
    if not PrimeNo%divisor=0:
                          ^
SyntaxError: invalid syntax

This time the caret is in the right place! ‘=’ needs to be ‘==’.

After I make all those changes your program still does not work, but the remaining problems do not seem to be syntax.

(I filed http://bugs.python.org/issue23518 on the misplaced carets.)

2

solved My variable keeps getting a syntax error. What should i do [closed]