Discuss / Python / 作业

作业

Topic source

zL丶_44830

#1 Created at ... [Delete] [Delete and Lock User]
def get_score_in(low, high):
    try:
        conn=sqlite3.connect(db_file)
        cursor=conn.cursor()
        cursor.execute('select name from user where score between ? and ? order by score',(low,high))
        namelist=cursor.fetchall()
    finally:
        cursor.close()
        conn.close()
    return [i[0] for i in namelist]

order by 默认升序排列


  • 1

Reply