Commit c7d0b23a by BellCodeEditor

save project

parent fcf5bfe2
Showing with 8 additions and 6 deletions
# 温酒斩华雄上 # 温酒斩华雄上
# 注意从现在开始,字符串用单引号咯 # 注意从现在开始,字符串用单引号咯
1=["关羽","夏侯淳","刘备","张飞"] 1=["关羽","夏侯淳","刘备","张飞"]
1.remove("张飞") 1.pop(3)
print(1) print(1)
\ No newline at end of file
# 勇于挑战的创造师,请运行以下代码,看看能不能删掉水果列表中的香蕉,运行结果是什么呢? a = ["悟空","小贝","八戒","波奇"]
list=['苹果','香蕉','西瓜','香蕉','桃子','香蕉'] a.remove("八戒")
list.remove('香蕉') a.append("诺依")
print(list) red = a[0:2]
\ No newline at end of file blue = a[-2:]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment