Making the len function work on your Python objects

Veröffentlicht am: 02 Oktober 2023
auf dem Kanal: Python Morsels
250
9

Want the built-in `len` function to work on your Python objects? Your class needs a `__len__` method!

https://pym.dev/making-the-len-functi...

Find more Python screencasts at https://pym.dev/screencasts/

00:00 The len function only works on objects that have a length
00:41 How to make instances of your class have a length?
01:41 Use a _len_ method to give your Python objects a length


Auf dieser Seite können Sie das Online-Video Making the len function work on your Python objects mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Python Morsels 02 Oktober 2023 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 250 Mal angesehen und es wurde von 9 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!