Python 术语表
使用 len() 方法返回数组的长度(数组中的元素数量)。
len()
返回 cars 数组中的元素数量:
x = len(cars)
亲自试一试
注意:数组的长度总是比最高的数组索引多 1。