diff --git a/diy1.py b/diy1.py deleted file mode 100644 index 79f7ffb..0000000 --- a/diy1.py +++ /dev/null @@ -1,22 +0,0 @@ -# 利用write()帮助悟空给诺依回信吧~ -import turtle - -screen=turtle.Screen() -screen.bgcolor("light blue") - -p=turtle.Pen() -p.penup() -p.goto(100,-100) -p.write("123456789\n123456789",font=("Times",28,"normal")) -p.hideturtle() -a=turtle.Pen() -a.pencolor("black") -a.pensize(5) -a.left(45) -a.forward(100) -a.circle(50,180) -a.right(90) -a.circle(50,180) -a.forward(100) -a.hideturtle() -turtle.done() diff --git a/h.py b/h.py new file mode 100644 index 0000000..2e890a1 --- /dev/null +++ b/h.py @@ -0,0 +1,9 @@ +name='刘强' +power=66 +hero=['赵一',30,'丁二',37,'孙五',52,'王猛',89,'周亮',98] +for i in range(len(hero)): + if i%2==1 and hero[i]>=power: + hero.insert(i-1,name) + hero.insert(i,power) + break +print(hero) \ No newline at end of file diff --git a/k.py b/k.py new file mode 100644 index 0000000..afa95a5 --- /dev/null +++ b/k.py @@ -0,0 +1,8 @@ +a=["苹果",10,"香蕉",7,"橘子",4,"梨",1] +b=["bb",6] +for i in range(len(a)): + if i%2==1 and a[i]<b[1]: + a.insert(i-1,b[1]) + a.insert(i-1,b[0]) + break +print(a) \ No newline at end of file