修改后的代码如下,望采纳
#算平均分、最高分
average = round (sum(scores) / Len(scores), 2)
print("平均分为:{:.2f}".format(average).center(20))
print("最高分为:{:.2f}".format(max(scores)).center(20))
print("最低分为:{:.2f}".format(min(scores)).center(20))
写法有误,要整段文字居中就不能用逗号在print,换一下写法
print("平均分为:{}".format(scores).center(20))