Article From:https://www.cnblogs.com/sea-stream/p/9971355.html

 

mycode = 'print("hello world")'  
code = """ 
def mutiply(x,y): 
    return x*y 
 
print('Multiply of 2 and 3 is: ',mutiply(2,3)) 
"""  
exec(mycode)  
exec(code)

 

Leave a Reply

Your email address will not be published. Required fields are marked *