python turtle库-读书笔记

 1 import turtle
 2 turtle.setup(800,400,200,200)
 3 turtle.penup()
 4 turtle.seth(90)
 5 turtle.fd(50)
 6 turtle.seth(0)
 7 turtle.pendown()
 8 turtle.pensize(2)
 9 turtle.fillcolor("yellow")
10 turtle.begin_fill()
11 turtle.circle(-100,360)
12 turtle.circle(-100,270)
13 turtle.end_fill()
14 turtle.pensize(10)
15 turtle.fillcolor("orange")
16 turtle.begin_fill()
17 turtle.circle(-50,180)
18 turtle.seth(90)
19 turtle.circle(-50,180)
20 turtle.seth(140)
21 turtle.pensize(5)
22 turtle.circle(80,80)
23 turtle.seth(140)
24 turtle.circle(80,80)
25 turtle.end_fill()
26 turtle.penup()
27 turtle.seth(0)
28 turtle.fd(50)
29 turtle.seth(-90)
30 turtle.fd(20)
31 turtle.pendown()
32 turtle.pensize(10)
33 turtle.pencolor("black")
34 turtle.circle(50,180)

 

 

------------恢复内容开始------------

------------恢复内容开始------------


 1 import turtle
 2 
 3 # 璁剧疆鍒濆浣嶇疆
 4 turtle.penup()
 5 turtle.left(90)
 6 turtle.fd(200)
 7 turtle.pendown()
 8 turtle.right(90)
 9 
10 # 鑺辫晩
11 turtle.fillcolor("red")
12 turtle.begin_fill()
13 turtle.circle(10,180)
14 turtle.circle(25,110)
15 turtle.left(50)
16 turtle.circle(60,45)
17 turtle.circle(20,170)
18 turtle.right(24)
19 turtle.fd(30)
20 turtle.left(10)
21 turtle.circle(30,110)
22 turtle.fd(20)
23 turtle.left(40)
24 turtle.circle(90,70)
25 turtle.circle(30,150)
26 turtle.right(30)
27 turtle.fd(15)
28 turtle.circle(80,90)
29 turtle.left(15)
30 turtle.fd(45)
31 turtle.right(165)
32 turtle.fd(20)
33 turtle.left(155)
34 turtle.circle(150,80)
35 turtle.left(50)
36 turtle.circle(150,90)
37 turtle.end_fill()
38 
39 # 鑺辩摚1
40 turtle.left(150)
41 turtle.circle(-90,70)
42 turtle.left(20)
43 turtle.circle(75,105)
44 turtle.setheading(60)
45 turtle.circle(80,98)
46 turtle.circle(-90,40)
47 
48 # 鑺辩摚2
49 turtle.left(180)
50 turtle.circle(90,40)
51 turtle.circle(-80,98)
52 turtle.fillcolor("yellow")
53 turtle.begin_fill()
54 turtle.seth(55)
55 turtle.circle(110,90)
56 turtle.left(90)
57 turtle.circle(110,90)
58 turtle.end_fill()
59 turtle.setheading(-83)
60 
61 # 鍙跺瓙1
62 turtle.fd(30)
63 turtle.left(90)
64 turtle.fd(25)
65 turtle.left(45)
66 turtle.fillcolor("green")
67 turtle.begin_fill()
68 turtle.circle(-80,90)
69 turtle.right(90)
70 turtle.circle(-80,90)
71 turtle.end_fill()
72 
73 turtle.right(135)
74 turtle.fd(60)
75 turtle.left(180)
76 turtle.fd(85)
77 turtle.left(90)
78 turtle.fd(80)
79 
80 # 鍙跺瓙2
81 turtle.right(90)
82 turtle.right(45)
83 turtle.fillcolor("green")
84 turtle.begin_fill()
85 turtle.circle(80,90)
86 turtle.left(90)
87 turtle.circle(80,90)
88 turtle.end_fill()
89 
90 turtle.left(135)
91 turtle.fd(60)
92 turtle.left(180)
93 turtle.fd(60)
94 turtle.right(90)
95 turtle.circle(200,60)

 


1
import turtle 2 turtle.setup(800,200,200,200) 3 turtle.penup() 4 turtle.fd(-250) 5 turtle.pendown() 6 turtle.pensize(25) 7 turtle.pencolor("yellow") 8 turtle.seth(-40) 9 for i in range(4): 10 turtle.circle(40,80) 11 turtle.circle(-40,80) 12 turtle.circle(40,80/2) 13 turtle.fd(40) 14 turtle.circle(16,180) 15 turtle.fd(40*2/3) 16 turtle.done()

 

turtle库的“初成长

1)黄色的小蛇

2)加工的后“变异”玫瑰

3)“诡异”的笑脸

 

 

 

 

 

 

------------恢复内容结束------------

------------恢复内容结束------------

posted @ 2020-03-11 20:59  木彳  阅读(307)  评论(0编辑  收藏  举报