Discuss / Python / 交作业

交作业

Topic source
def get_score_in(low, high):
    ' 返回指定分数区间的名字,按分数从低到高排序 '
    conn=sqlite3.connect(db_file)
    cursor=conn.cursor()
    cursor.execute(f'select name from user where score between {low} and {high} order by score')
    tupleList=cursor.fetchall()
    return [dataTuple[0] for dataTuple in tupleList]

大佬,能解释下这句吗?

cursor.execute(f'select name from user where score between {low} and {high} order by score')

black度厄

#3 Created at ... [Delete] [Delete and Lock User]

@我想吃火锅要加油哦

black度厄

#4 Created at ... [Delete] [Delete and Lock User]

从user表中查找name,条件是score在low和high之前的。order by 是一个排序语句

black度厄

#5 Created at ... [Delete] [Delete and Lock User]

之间的,打错了


  • 1

Reply