Answers for "how to add variable to a string python"

2

how to give a string value variable in python

foo = "bar"
exec(foo + " = 'something else'")
print bar
something else
Posted by: Guest on April-04-2021

Code answers related to "how to add variable to a string python"

Python Answers by Framework

Browse Popular Code Answers by Language