3 ms·
This SyntaxErrors for me. >>> from types import * >>> mycode = "a = int(raw_input()); print a * 2; return a" >>> myfunc = FunctionType(compile(myco
by wging 13y ago
This SyntaxErrors for me.
>>> from types import *
>>> mycode = "a = int(raw_input()); print a * 2; return a"
>>> myfunc = FunctionType(compile(mycode,"<string>","exec"), globals())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 1
SyntaxError: 'return' outside function
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 1
SyntaxError: 'return' outside function