How to Insert variable value to string python?
I need to insert 'g' value to {g} in html text.

tried f string and it doesn't work
You can use str.format to insert value into {g} in your example
g = 234
text = '''
<p>Hi {g}!</p>
'''
print(text.format(g=g))