作业帮 > 综合 > 作业

python 问题>>> counter = 0>>> miles = 1000.0>>> name = 'Bob'>>

来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/19 19:27:59
python 问题
>>> counter = 0
>>> miles = 1000.0
>>> name = 'Bob'
>>> counter = counter + 1
>>> kilometers = 1,609 * miles
>>> print '%f miles is the same as &f km' % (miles, kilometers)
Traceback (most recent call last):
File "", line 1, in
print '%f miles is the same as &f km' % (miles, kilometers)
TypeError: not all arguments converted during string formatting
怎么回事?
? 有什么不同?
python 问题>>> counter = 0>>> miles = 1000.0>>> name = 'Bob'>>
print '%f miles is the same as %f km' % (miles, kilometers)