在cmd上运行时出现了这个错误,
Traceback (most recent call last):
File "F:\python_code\total", line 19, in
print('%s同学编程投入资金%f元。'%(counts[i],counts[i+1]))
TypeError: must be real number, not str
然后我在linux虚拟机上的python运行也是类似情况
Traceback (most recent call last):
File "./total.py", line 20, in
print('%s同学编程投入资金%f元'%(counts[i],counts[i+1]))
TypeError: float argument required, not str
我在windows上安装的python是3.7版本
虚拟机上linux的python是2.6.6版本
上面问题希望有大佬帮忙看一下,萌新小白,实在是不懂哪里出问题了