📜  python 追加到列表 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:15.243000             🧑  作者: Mango

代码示例6
stuff = ["apple", "banana"]
stuff.append("carrot")
# Print to see if it worked
print(stuff)
# You can do it with a variable too
whatever = "pineapple"
stuff.append(whatever)
# Print it again
print(stuff)