【发布时间】:2010-03-04 02:13:23
【问题描述】:
我怎么会收到这个错误?
我的代码:
def cat_n_times(s, n):
while s != 0:
print(n)
s = s - 1
text = input("What would you like the computer to repeat back to you: ")
num = input("How many times: ")
cat_n_times(num, text)
错误:
TypeError: unsupported operand type(s) for -: 'str' and 'int'
【问题讨论】:
标签: python python-3.x