Discuss / Python / 参考评论以后交作业

参考评论以后交作业

Topic source
    conn = sqlite3.connect('test.db')
    cursor = conn.cursor()
    #执行查询语句:
    cursor.execute('select * from user where score between ? and ? order by score', (low, high))

    # 获得查询结果集:
    values = cursor.fetchall()          
    return [x[1] for x in values]

    cursor.close()
    conn.close()

  • 1

Reply