This commit is contained in:
krahets
2023-05-22 22:01:18 +08:00
parent 29807a3761
commit be77ba7a70
16 changed files with 60 additions and 58 deletions

View File

@@ -434,12 +434,12 @@ comments: true
```python title="list.py"
# 通过索引遍历列表
count: int = 0
count = 0
for i in range(len(list)):
count += 1
# 直接遍历列表元素
count: int = 0
count = 0
for n in list:
count += 1
```