This commit is contained in:
krahets
2023-08-06 23:19:07 +08:00
parent fafdebb75c
commit 48adefba25
8 changed files with 136 additions and 33 deletions

View File

@@ -39,9 +39,9 @@ comments: true
```python title="list.py"
# 初始化列表
# 无初始值
list1: List[int] = []
list1: list[int] = []
# 有初始值
list: List[int] = [1, 3, 2, 5, 4]
list: list[int] = [1, 3, 2, 5, 4]
```
=== "Go"
@@ -650,7 +650,7 @@ comments: true
```python title="list.py"
# 拼接两个列表
list1: List[int] = [6, 8, 7, 10, 9]
list1: list[int] = [6, 8, 7, 10, 9]
list += list1 # 将列表 list1 拼接到 list 之后
```