Return the variable of the 1st exec function in the second exec function in python

Viewed 10

I'm makin' my own programming language. And I came across this issue, it is that the variable of the 1st exec function is not printing when I call out(a), it prints NONE. How do I rectify it. Please help. My Code:

print("""
Welcome to PI. Type your code below to execute.
""")

def out(output):
    print(output)

def inp(inputcommand):
    input(inputcommand)

while 1:
    command = input(">>>")
    exec(command)

Issue:

issue

0 Answers
Related