可以使用内置函数len()来获取列表的长度,示例代码如下:

a = [1, 2, 3, 4, 5]
print(len(a))  # 输出:5

变量a是一个列表,使用len()函数获取列表的长度,输出结果为5。

python3 变量a是一根列表输出列表长度