Commit a7ed2a6d by BellCodeEditor

save project

parent 688c6848
Showing with 16 additions and 14 deletions
# 温酒斩华雄上 a=['华雄']
# 注意从现在开始,字符串用单引号咯 b=['颜良','文丑','潘SB']
# 和你的小伙伴用列表讲讲温酒斩华雄的故事,上半集,并完成下面的挑战: print(a)
print(b)
#这时还是无名小卒的关羽上前请战,请从b列表中删掉“关羽”,用三种方法哦。 a.extend(b)
b=['袁术','夏侯惇','曹操','关羽'] print(a)
# b.pop(3) print("潘SB战死疆场,被敌军乱箭射成刺猬")
# b.pop(-1) a.pop(-1)
# b.remove('关羽')
print(b) print(b)
\ No newline at end of file
# 勇于挑战的创造师,请运行以下代码,看看能不能删掉水果列表中的香蕉,运行结果是什么呢? name=["Jonh",'Sam','Lily','Anna','Daming','Helen']
list=['苹果','香蕉','西瓜','香蕉','桃子','香蕉'] name.insert(5,'Sally')
list.remove('香蕉') print(name)
print(list) name[2]='Nina'
\ No newline at end of file print(name)
name.pop(-3)
print(name)
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