【发布时间】:2019-04-03 13:59:10
【问题描述】:
我正在尝试打印我的排行榜,但它打印在一行而不是多行。
到目前为止,这是我的代码:
cursor.execute('SELECT username, score FROM Players order by score DESC limit 5')
topscore = cursor.fetchall()
topscore = list(topscore)
print(topscore)
当它运行时,它的输出如下: [('VortexHD', 6), ('test', 0), ('TestOCR', 0)]
但是我希望它在单独的行上输出名称和分数,如下所示:
VortexHD,6
测试,0
TestOCR, 0
感谢您的任何帮助。
【问题讨论】: