Commit 73f7b332 by BellCodeEditor

save project

parent ff9d3f49
Showing with 18 additions and 5 deletions
# 勇于挑战的创造师,请运行以下代码,看看能不能删掉水果列表中的香蕉,运行结果是什么呢? hero=['美眉',10,'美眉2',20,'美眉3',30,'美眉4',40,'美眉5',50]
list=['苹果','香蕉','西瓜','香蕉','桃子','香蕉'] name = '王胜'
list.remove('香蕉') power = 25
print(list) while True:
\ No newline at end of file
name = input('输入你想要的美眉:')
if(name == 'q'): break
power = int(input('输入你理想美眉的分数:'))
for i in range(len(hero)):
if (i % 2 != 0 and hero[i] >= power):
hero.insert(i-1,name)
hero.insert(i,power)
break
else:
hero.extend([name,power])
print(hero[-1:-7:-1])
print("退出")
\ 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