Nov-03-2020, 01:00 PM
(Nov-02-2020, 07:20 PM)felixf Wrote:I tried to replace 'return' with 'break', but that did not seem to help as well.
Error:SyntaxError: 'return' outside function
Can I know what i am doing wrong here?
return
may only occur syntactically nested in a function definition.For more information: Documentation > The Python Language Reference > 7. Simple statements > 7.6. The return statement.
break
may only occur syntactically nested in a for or while loopFor more information: Documentation > The Python Language Reference > 7. Simple statements > 7.9. The break statement
As you have no function defined nor for- or while-loop therefore neither
return
or break
is allowed.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.