Thursday, 28 July 2022

Python put variable in string

https://stackoverflow.com/questions/2960772/how-do-i-put-a-variable-s-value-inside-a-string




>>> name = "Fred"
>>> f"He said his name is {name}."
'He said his name is Fred.'

No comments:

Post a Comment