I am a new to python programming and trying to understand how it works while editing a string file. I wanted to call either variables or lists or tuple in a string and solve the values and update the string file. Here is a simple example
t_list = ['c','d','e']
doc = '''
domain ()
:types a b c - objects
f"{t_list}" - items
'''
doc_up = doc
I wanted my doc_up
to be updated with values of list t_list
. I referred to PEP 498: Formatted string literals but it doesn't work.
My output is like this:
'\n domain ()\n :types a b c - objects\n f"{t_list}" - items\n'
I want my output to be like this:
domain ()
:types a b c - objects
c d e - items