How to get variable value from full string see the sample

how to get variable value from full string see the sample
var1 =“varablevalue’
testvar = 'testing”“& var1 &”" endtext’
need full data with var1 value
waiting for your valueable reply

Hi @badar

You could use f-strings for this…

var1 = 'varablevalue'
testvar1 = f"testing {var1} endtext"
print(testvar1)

var2 = 123
testvar2 = f"testing {var2} endtext"
print(testvar2)

Cheers