我正在编写一个程序,它需要确定数字的范围,就好像我将 15 放在 user_input 'a' 中,所以它应该打印从 'a' 到 'b' 的范围,但不幸的是我无法解决它可以任何人请帮我解决这个问题。这是我的代码:
a = int(raw_input("How many did you say you're going to count down? "))
b = int(raw_input("When are you actually going to stop? "))
i = 0
for i in range(a, b):
i = i + 1
print i
我希望它像这样工作:
How many did you say you're going to count down? 15
When are you actually going to stop? 8
15
14
13
12
11
10
9
8
或者
How many did you say you're going to count down? 6
When are you actually going to stop? 4
6
5
4