万千封印
描述len() 方法返回列表元素个数。语法len()方法语法:len(list)参数list -- 要计算元素个数的列表。返回值返回列表元素个数。实例以下实例展示了 len()函数的使用方法:#!/usr/bin/pythonlist1, list2 = [123, 'xyz', 'zara'], [456, 'abc']print "First list length : ", len(list1);print "Second list length : ", len(list2);以上实例输出结果如下:First list length : 3Second lsit length : 2