【发布时间】:2020-05-27 12:11:45
【问题描述】:
counter = 10
numbers = int(input("Enter a number between 10 and 99: "))
column = int(input("How many columns would you like? "))
for num in range(10, numbers):
for col in range(column):
counter += 1
print(num + 1, end= ' ')
print()
尝试从 10 数到提供的输入值和 Python 中提供的列,但没有得到它。我基本上想要顶部 5 个数字,底部 5 个等。
【问题讨论】:
-
内部for循环中counter += 1的作用是什么?
-
您能否为不同的输入添加一些示例,以了解您想要实现的目标?
标签: python python-3.x spyder juniper