æè¿°
len() æ¹æ³è¿åå表å
ç´ ä¸ªæ°ã
è¯æ³
len()æ¹æ³è¯æ³ï¼
len(list)
åæ°
list -- è¦è®¡ç®å
ç´ ä¸ªæ°çå表ã
è¿åå¼
è¿åå表å
ç´ ä¸ªæ°ã
å®ä¾
以ä¸å®ä¾å±ç¤ºäº len()å½æ°ç使ç¨æ¹æ³ï¼
#!/usr/bin/python
list1, list2 = [123, 'xyz', 'zara'], [456, 'abc']
print "First list length : ", len(list1);
print "Second list length : ", len(list2);
以ä¸å®ä¾è¾åºç»æå¦ä¸ï¼
First list length : 3
Second lsit length : 2
温馨提示:内容为网友见解,仅供参考