Commit beb9e082 by BellCodeEditor

save project

parent 3efa706c
Showing with 4 additions and 8 deletions
# 温酒斩华雄上
# 注意从现在开始,字符串用单引号咯
# 和你的小伙伴用列表讲讲温酒斩华雄的故事,上半集,并完成下面的挑战:
#这时还是无名小卒的关羽上前请战,请从b列表中删掉“关羽”,用三种方法哦。
name="张三"
power=66
name=input("请问你的名字是什么:")
power=int(input("请输入臂力值:"))
b=['袁术',30,'夏侯惇',37,'曹操',52,'关羽',89,'刘备',98,]
for i in range(len(b)):
if i%2==1 and b[i]>=power:
b.insert(i-1,name)
b.insert(i,power)
break
print(b)
print(b[-6:])
\ 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