Skip to content

Commit e1c58b2

Browse files
committed
对python3 dictionary的补充
1 parent e851a99 commit e1c58b2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎117.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,8 @@ get的含义是:
307307

308308
这里先交代一句,如果要实现对键值对或者键或者值的循环,用迭代器的效率会高一些。对这句话的理解,在后面会给大家进行详细分析。
309309

310+
> 在python3中, 只有items, keys和values方法, 返回的也不是list, 而是[view对象](https://docs.python.org/3/library/stdtypes.html#dict-views)
311+
310312
###pop, popitem
311313

312314
在[《列表(3)》](./113.md)中,有关于删除列表中元素的函数`pop`和`remove`,这两个的区别在于`list.remove(x)`用来删除指定的元素,而`list.pop([i])`用于删除指定索引的元素,如果不提供索引值,就默认删除最后一个。

0 commit comments

Comments
 (0)