Commit 381b504c by BellCodeEditor

save project

parent fd8cc876
Showing with 10 additions and 14 deletions
# 勇于挑战的创造师,请运行下面的代码,观察运行结果,和小伙伴们说说你的发现? name="刘强"
a= ['华雄'] power=66
c=['颜良','文丑'] hero=['赵一',30,'丁二',37,'孙武',52,'王猛',89,'周亮',98]
a.extend(c) #自动排序
print(a) for i in range(len(hero)):
if i%2==1 and hero[i]>=power:
a=['华雄','颜良'] hero.insert(i-1,name)
a.insert(2,'文丑') hero.insert(i,power)
print(a) break
print(hero)
a=['华雄','颜良']
a.append('文丑')
print(a)
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