我不明白代码有什么问题,它非常简单,所以这很容易。
x = input("Give starting number: ")
y = input("Give ending number: ")
for i in range(x,y):
print(i)
它给了我一个错误
Traceback (most recent call last):
File "C:/Python33/harj4.py", line 6, in <module>
for i in range(x,y):
TypeError: 'str' object cannot be interpreted as an integer
例如,如果 x 是 3 而 y 是 14,我希望它打印
Give starting number: 4
Give ending number: 13
4
5
6
7
8
9
10
11
12
13
问题是什么?