Skip to content

Tag: return

Python3 exec, why returns None?

When the code below this text, and returns the result None why? with open(‘exx.py’, ‘rb’) as file: ff = compile(file.read(), ‘exx.py’, ‘exec’) snip_run = exec(ff, locals()) if ‘result’ in locals(): …