Tony wrote:
The full error message says "There's an error in your program: *** 'return' outside function (final(2).py, line 114)

Ah, you left the quotes off before, and you still omitted the error class (SyntaxError, see below).

When you are puzzled by an error, try to reduce the executed code to the MINIMUN needed to get the error. (You can use your editor's block comment feature -- for IDLE see Format/Comment out [marked] region.)
For your error, the minimum is

>>> return
SyntaxError: 'return' outside function (<pyshell#1>, line 1)

Return statements are only value inside functions and not in module level code. Perhaps you think you 'return' is in a function but it is not because it is not indented.

Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to