Sunday, November 6, 2011

Python: get length of a list


a = ['spam', 'eggs', 100, 1234]
print len(a) // 4


Source:
http://www.java2s.com/Code/Python/List/Builtinfunctionlengetthelengthofalist.htm

No comments: