在Python中,你可以使用`for`循环和`while`循环来输出循环数字。以下是两种方法的示例:
使用`for`循环输出数字
```python
输出1到10的数字
for i in range(1, 11): 注意:range的上限是不包含的
print(i)
输出10到1的数字
for i in range(10, 0, -1):
print(i)
使用`while`循环输出数字
```python
输出0到9的数字
count = 0
while count < 10:
print(count)
count += 1
以上代码示例展示了如何使用`for`循环和`while`循环按顺序输出数字。你可以根据需要修改循环的起始值、结束值和步长来控制输出的数字范围和顺序。