Commit b0c028b5 by BellCodeEditor

save project

parent c43bc531
Showing with 14 additions and 1 deletions
# 臂力挑战赛
# 快用你机灵的小脑瓜想想,如何将刘强和他的臂力值自动插入到hero列表中?
"""
name=input("你叫什么名字")
power=int(input("你的臂力值是多少"))
hero=['赵一',30,'丁二',37,'孙五',52,'王猛',89,'周亮',98,'张宇',100]
......@@ -10,4 +11,15 @@ for i in range(len(hero)):
hero.insert(i,power)
break
print(hero[-6:])
"""
"""
name=['jonh','sam','lily','anna','daming','helen']
name[2]="nina"
name.insert(5,"sally")
name.pop(3)
print(name)
"""
name=['jonh','sam','nina','daming','sally','helen']
a=['jonh','sam','nina','daming','sally','helen','xiaoli','qiang','neo']
name.extend(a)
print(name[2:7])
\ 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