【发布时间】:2022-06-17 00:10:55
【问题描述】:
我收到此错误 ValueError: invalid literal for int() with base 10: when o enter any value。请检查我的代码哪里出错了。我最近开始使用python,所以如果可能,请指出代码中是否存在任何其他错误。
total = 0
print('This program helps you calculate the sum and mean of the enter numbers. ')
x = (int(input('Please enter the numbers you want to apply the functions to : ')))
for number in [x] :
total = total + number
y = x.count()
mean = total / x
print('Total : ' , total)
print('Mean : ' , mean)
【问题讨论】:
-
你对
int("1,2")有什么期望?
标签: python