a= [6248.570994, 5282.059503, 5165.000653, 5130.795058, 5099.376451]
一个办法:如何转换浮动名单蟒蛇为int列表
a=map(int, a)
的其他方式:
int_a=[]
for intt in a:
int_a.append(int(intt))
以上几种方式可以打印正确的答案,但是当我要排序的我遇到问题:
maxx=sorted(int_a,reverse=True)[:1]*1.2
print maxx
TypeError: can't multiply sequence by non-int of type 'float'
这是您使用 – felipsmartins
哪个版本的Python对我的作品? – NightShadeQueen
你可以把完整的追溯? –