IndexError: list index out of range python (flask)

Solution 1
{% if data %}
{% for row in data %}
  • {{ row[1] }}
  • {% endfor %} {% else %}
  • No Record Found.
  • {% endif %}
    Solution 2
    In [420]: r = []
    In [421]: r[0]
    ---------------------------------------------------------------------------
    IndexError                                Traceback (most recent call last)
     in 
    ----> 1 r[0]
    
    IndexError: list index out of range