+ 2

What is len

In many of the python codes, I discovered that there was a command language called "len".I wonder what it is....

28th Nov 2017, 8:36 AM
Jinsu
3 odpowiedzi
+ 3
it's returns length of objects or parameters a=[1,2,3,4] print len(a) #4 no of elements b='hello' print len(b) #5 no of characters
28th Nov 2017, 8:46 AM
Pavan Kumar T S
Pavan Kumar T S - avatar
+ 6
I think that is length.
28th Nov 2017, 8:40 AM
Vukan
Vukan - avatar
+ 5
len means length. it calculates the length of the list: list = [1,2,3,4,5,6,7] print(len(list)) #outputs 7
28th Nov 2017, 8:52 AM
Cat🐈
Cat🐈 - avatar