+ 2
What is "len"?
Excuse me, I'm new of programming and can't know more. Can you tell me, what is "len" in Phyton? Is it a function or something else?
3 ответов
+ 2
Thank you everyone who answered)
Len is really cool💪
+ 1
This is a function which tells you the length of a variable you give if it's a list so how many elements there are etc.
+ 1
I think len is very cool as it can be used for maybe all builtin iterables.
You can use:
len(list)
len(str)
len(range)
len(dict)
And they all give the expected output.
In Java the way to get a size of an iterable can change, strings use length method:
String.length()
While arrays use length propery:
array.length
ArrayLists might also have third way to get the array length.