📜  添加到列表 python 代码示例

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

代码示例6
fruits = ["Apple", "Banana"]

# 1. append()
print(f'Current Fruits List {fruits}')

f = input("Please enter a fruit name:\n")
fruits.append(f)

print(f'Updated Fruits List {fruits}')