diff --git a/1.py b/1.py new file mode 100644 index 0000000..8a954f5 --- /dev/null +++ b/1.py @@ -0,0 +1,6 @@ +a="天" +b="地" +c=a +a=b +b=c +print(a,b) \ No newline at end of file diff --git a/diy0.py b/diy0.py new file mode 100644 index 0000000..8a954f5 --- /dev/null +++ b/diy0.py @@ -0,0 +1,6 @@ +a="天" +b="地" +c=a +a=b +b=c +print(a,b) \ No newline at end of file diff --git a/diy1.py b/diy1.py new file mode 100644 index 0000000..93aa661 --- /dev/null +++ b/diy1.py @@ -0,0 +1,23 @@ +import turtle +import random +turtle.speed(0) +turtle.bgcolor("black") +turtle.pensize(2) +turtle.pencolor("white") +acc_ext=0 +r=10 +turtle.penup() +turtle.goto(0,-r) +turtle.pendown() +while True: + turtle.color(random.choice(["white","black"])) + ext=random.random()*90 + turtle.circle(r,ext) + acc_ext+=ext + if acc_ext>360: + acc_ext=0 + turtle.penup() + turtle.goto(0,-r) + turtle.setheading(0) + turtle.pendown() + r+=3 \ No newline at end of file diff --git a/diy2.py b/diy2.py index 2bc971e..7aa5224 100644 --- a/diy2.py +++ b/diy2.py @@ -1,4 +1,11 @@ -message = "诺依,周末一起去看动漫展吧!" - -# 请对message进行遍历,取出所有元素 - +import turtle +pen=turtle.Pen() +pen.pendown() +pen.pensize(2) +pen.pencolor("red") +turtle.speed(20) +for i in range(100): + pen.circle(i+20) + pen.right(20) +pen.hideturtle() +turtle.done() \ No newline at end of file