Python语言中用于实现循环结构的语句主要有两种: for循环和 while循环。
for循环
`for`循环通常用于遍历序列(如列表、元组、字符串)或其他可迭代对象。
语法结构:`for 变量 in 序列:`
示例:
```python
for i in range(5):
print(i)
```
输出:
```
0
1
2
3
4
```
while循环
`while`循环会在条件为真时重复执行一段代码块。
语法结构:`while 条件:`
示例:
```python
i = 0
while i < 5:
print(i)
i += 1
```
输出:
```
0
1
2
3
4
```
建议在实际编程中根据具体需求选择合适的循环结构,以便更高效地实现代码。