Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python string to var

myStr = "domain"
myVal = "pythonforbeginners.com"
myTemplate = "{} = "{}""
statement = myTemplate.format(myStr, myVal)
exec(statement)
print(domain)
Source by www.pythonforbeginners.com #
 
PREVIOUS NEXT
Tagged: #Python #string #var
ADD COMMENT
Topic
Name
1+8 =