I'm trying to write a function that automatically sets up a HTML file using information from a list I've generated. This chunk below is part of a multi-line string.
`"""...
<tr>
<td>10</td>
<th>"""+str(List_Data[9])+"""</th>
<th>"""+str(Extra_Data[9])+"""</th>
</tr>
</table>
..."""`
Extra_Data is a list of number ratings, so Extra_Data[9] = 7.2. When I run the code I get the following error;
`<th>"""+str(Extra_Data[9])+"""</th>
TypeError: can only concatenate str (not "list") to st`
I'm not sure how else I could get this to work since str(Extra_Data[9]) doesn't do the trick and this is the only way I can think to get all of my listed data to be apart of the HTML code efficiently. Any help would be appreciated!
Thanks in advance.
str?strtolist(but not the other way around). And even ifstrdid not do anything,Extra_Data[9]should befloatand notlist.Extra_Dataetc. In fact, chances are that doing this, you will find the error yourself.