Skip to content
Advertisement

Flask: Python List is displaying values in HTML file with quote marks and round brackets

I have the below function which returns a list

JavaScript

It is being called this way

JavaScript

and passed to the html file this way

JavaScript

The display code in HTML file is as below

JavaScript

but it is being displayed with round brackets and quote marks as below display shows list with round brackets and quote marks

The query getting the values from database is as below

JavaScript

I added a print statement in my python code to check what gets returned by the function and that is as below (shows with the brackets and quote marks)

JavaScript

How do I display the data without the brackets and quote marks?

Advertisement

Answer

Your curr variable contains tuples. try this code:

JavaScript

I think you need to check of index out for range error.

I hope this helps.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement