Ask Your Question

how to find the syntax error

asked 2018-03-08 12:58:58 +0200

florin gravatar image


Here's a short code (copy-paste) that gets me syntax error i=3 while i>0 : print i, 'looping'    i=i-1

"<ipython-input-7-8e7eba3f21a0>", line 4 i=i-Integer(1)

I retyped it a second time; now it works, but I don't see any difference. i=3 while i>0 : print i, 'looping' i=i-1

Retyping only the line 4 with the error won't help, retyping the previous lines or restarting the kernel won't help either. It's like a phantom error

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2018-03-08 13:07:23 +0200

florin gravatar image

The indentation was fine, I just didn't know how to preserve it in the question by copy paste I indented the code with syntax error by hand to show you (but this still doesn't show in preview),
I recopied it into Sage, it works now. I'll go by a gun

i=3 while i>0 : print i, 'looping'

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2018-03-08 12:58:58 +0200

Seen: 341 times

Last updated: Mar 08 '18