x = int(input("Enter the start Number:"))
y = int(input("Enter the end number:"))
while(start < end):
start = start + 10
new = start + 10
print start, new
请有人帮助我。 我希望输出像
10,20
20,30
30,40
40,50
答案 0 :(得分:1)
你想要这样的东西吗?
start = int(input("Enter the start Number:"))
end = int(input("Enter the end number:"))
while(start < end):
print start, start + 10
start = start + 10
答案 1 :(得分:1)
如果你已经知道要循环多少次,那么使用for
循环和range
要简洁得多:
start = int(input("Enter the start Number:"))
end = int(input("Enter the end number:"))
for n in range(start, end, 10):
print(n, n + 10)