+ 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....
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
+ 6
I think that is length.
+ 5
len means length.
it calculates the length of the list:
list = [1,2,3,4,5,6,7]
print(len(list))
#outputs 7