def get_score_in(low, high):
sq=sqlite3.connect(db_file)
cur=sq.cursor()
cur.execute(r'select name from user a where a.score>=? and a.score<=? order by score' ,(low,high))
res=cur.fetchall()
cur.close()
sq.close()
lst=[]
for elem in res:
lst.append(elem[0])
#print(lst)
return lst
盖子是个熊孩子
本来是写了这个的。
后来看了同学们的代码,他们的return更加pythonic