增加元素可用:append insert
语法应用举例
nums = [9,8,7,6,5] nums.append(4) nums.insert(2,11) print(nums) print(len(nums))
结果如下:
/usr/local/bin/python3.6 "/Users/muxiuyulin/Desktop/study python/test4.py"
[9, 8, 11, 7, 6, 5, 4]
7
Process finished with exit code 0