>>> print(len.__doc__)
len(module, object)
Return the number of items of a sequence or mapping.
>>> len(os, 1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: len() takes exactly one argument (2 given)
Zauważ parametry dwa w pierwszym wierszu docstringu.Co to jest "moduł" w docstringie len?
Kiedy przekażesz dwa argumenty do len
? Czy docstring jest nieprawidłowy? Używam Pythona 3.4.0.
Dla mnie 'print (len .__ doc __)' odbitki ** len (Object) Zwraca liczbę elementów w sekwencji lub kolekcja. ** – falsetru
@falsetru To dziwne. Z której wersji Pythona korzystasz? – rightfold
Używam Pythona 3.4.2 – falsetru