Commit e984af6f by BellCodeEditor

save project

parent 1a7a77a7
Showing with 4 additions and 4 deletions
# 勇于挑战的创造师,请运行下面的代码,观察运行结果,和小伙伴们说说你的发现? # 勇于挑战的创造师,请运行下面的代码,观察运行结果,和小伙伴们说说你的发现?
name='sunzi' name=input('what is your name ')
power=32 power=int(input('how heavy are you'))
h=['xuansun',28,'zengsun',31,'erzi',36,'wo',56,'baba',88] h=['xuansun',28,'zengsun',31,'erzi',36,'wo',56,'baba',88]
for i in range(len(h)): for i in range(len(h)+1):
if i%2==1 and h[i]>=power: if i%2==1 and h[i]>=power:
h.insert(i-1,name) h.insert(i-1,name)
h.insert(i,power) h.insert(i,power)
break break
print(h) print(h[-6:])
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