mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-24 18:43:59 +08:00
Unify the comment style of python codes
This commit is contained in:
@@ -80,10 +80,10 @@
|
||||
=== "Python"
|
||||
|
||||
```python title="hash_map.py"
|
||||
""" 初始化哈希表 """
|
||||
# 初始化哈希表
|
||||
mapp: Dict = {}
|
||||
|
||||
""" 添加操作 """
|
||||
# 添加操作
|
||||
# 在哈希表中添加键值对 (key, value)
|
||||
mapp[12836] = "小哈"
|
||||
mapp[15937] = "小啰"
|
||||
@@ -91,11 +91,11 @@
|
||||
mapp[13276] = "小法"
|
||||
mapp[10583] = "小鸭"
|
||||
|
||||
""" 查询操作 """
|
||||
# 查询操作
|
||||
# 向哈希表输入键 key ,得到值 value
|
||||
name: str = mapp[15937]
|
||||
|
||||
""" 删除操作 """
|
||||
# 删除操作
|
||||
# 在哈希表中删除键值对 (key, value)
|
||||
mapp.pop(10583)
|
||||
```
|
||||
@@ -271,7 +271,7 @@
|
||||
=== "Python"
|
||||
|
||||
```python title="hash_map.py"
|
||||
""" 遍历哈希表 """
|
||||
# 遍历哈希表
|
||||
# 遍历键值对 key->value
|
||||
for key, value in mapp.items():
|
||||
print(key, "->", value)
|
||||
|
||||
Reference in New Issue
Block a user