Python
hou79068935
这个作者很懒,什么都没留下…
展开
-
Iterator and Iterable
An iterable is an object that has an __iter__ method which returns an iterator, or which defines a __getitem__ method that can take sequential indexes starting from zero (and raises an IndexError wh...转载 2018-08-08 20:25:47 · 144 阅读 · 0 评论 -
Python Notes
Python 函数参数传递的方式是 Call-by-Object,或者 Call by Object Reference。当传递 int,str,tuple 等不可变变量时,类似于传值,当传递 list 等可变变量时,类似与传引用。 def test(list_): print id(list_) list_.append(3) print id(list_) ...原创 2018-08-08 20:48:58 · 338 阅读 · 0 评论