I have a long string that I build with a bunch of calculated values. I then write this string to a file. I have it formatted like:
string = str(a/b)+\
'\t'+str(c)\
'\t'+str(d)\
...
'\n'
I would like to add comment to what each value represents but commenting with #
or '''
doesn't work. Here's an example:
string = str(a/b)+\ #this value is something
'\t'+str(c)\ #this value is another thing
'\t'+str(d)\ #and this one too
...
'\n'
I figured out it doesn't work :) so I'm wondering what code with a clean syntax would look like in a situation like this.
The only option that occurs to me would be to go for string +=
on each line but I'm scratching my head with "there must be a better way".