title: List index out of range?
body: <pre><code>def print_db():
      con = lite.connect('master.db')
      print ('Enter a first name:')
      firstname = input('&gt; ')
      with con:
          cur = con.cursor()
          data = cur.fetchone()
          cur.execute("SELECT * FROM Contacts WHERE First = (?);", (firstname,))
          list_title = ['First Name', 'Last Name', 'Phone', 'Email']
          k = 0
          for i in cur:
              print ("\n")
              for j in i:
                  print (list_title[k],)
                  print (j)
                  if k &lt; 5: k+=1
                  else:
                      k = 0
  
      print (data)
      print ('Enter 1 to return to main menu')
      userinput = input('&gt; ')
      if userinput == "1":
          main()
      else:
          main()
  </code></pre>
  
  <blockquote>
    <p>traceback list index out of range at print (list_title)[k],)</p>
  </blockquote>
  
  <p>Ok updated so you can see the whole function.</p>