What I am trying to do is
x = "string1"
y = "string2"
and output should be
string1 = "string2"
I have tried:
exec("%s = %s" % (x,y))
If I put y =2 #or any number
It will give the desired result but when I assign a string (y= "anystring" it tries to execute anystring and gives error:
NameError( name "anystring" is not defined
Maybe I don't know exactly how to use the exec command. Any kind of help/suggestion would be helpful.