Python自学:第三章 使用del语句删除元素

motorcycles = ["honda", "yamaha", "suzuki"]
print(motorcycles)

del motorcycles[1]
print(motorcycles)

输出为:

['honda', 'yamaha', 'suzuki']
['honda', 'suzuki']

 

posted @ 2019-04-18 08:16  Johnson蚂蚁  阅读(528)  评论(0编辑  收藏  举报