number=int(input("Please enter a number: "))
for b in range(1,11):
b=int(b)
output=int (number) *int (b)
print(+str (b) +" times "+ str (number) +" is " +output)
我希望程序询问一个数字,然后将其时间表打印到 10*number,但是我不断收到此错误。顺便说一句,我正在做 GCSE 计算。
Traceback (most recent call last):
File "C:\Users\jcowp_000\Documents\School\Lutterworth\Computing\Documents_-_-___________---________---______-_-_-_-__-__\Python\Python manual tasks.py", line 21, in <module>
print(+str (b) +" times "+ str (number) +" is " +output)
TypeError: bad operand type for unary +: 'str'