The len function

The len function expects a collection as input and returns the length of this collection—in other words, how many elements it consists of.

We measure the length of the string object in the following code, which is also iterable—you can think of it as a collection of characters:

>>> len('Hello')
5

Indeed, there are five characters in this word!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.131.213