Python自学:第三章 使用方法pop()删除元素

motorcycle = ["honda", "yamaha", "suzuki"]

last_owned = motorcycle.pop()
print("The last motorcycle I owned was a " + last_owned.title() + ".")

输出为:

The last motorcycle I owned was a Suzuki.

 

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