码迷,mamicode.com
首页 > 其他好文 > 详细

4个同心圆

时间:2017-04-14 09:51:55      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:style   circle   pytho   turtle   nbsp   import   end   gre   bsp   

 

接触python一段时间了,虽然不能熟练地运用,但还是希望有所尝试。

 1 import turtle 
 2 
 3 turtle.penup() #the first circle
 4 
 5 turtle.goto(0,-400) 
 6 
 7 turtle.pendown() 
 8 
 9 turtle.circle(400)
10 
11 turtle.color("red")
12 
13 turtle.pensize(30)
14 
15 turtle.penup()#the second circle 
16 
17 turtle.goto(0,-300) 
18 
19 turtle.pendown() 
20 
21 turtle.circle(300)
22 
23 turtlt.color("yellow")
24 
25 turtle.pensize(30)
26 
27 turtle.penup() #the third circle
28 
29 turtle.goto(0,-200) 
30 
31 turtle.pendown() 
32 
33 turtle.circle(200)
34 
35 turtle.color("green")
36 
37 turtle.pensize(40)
38 
39 turtle.penup() #the fourth circle
40 
41 turtle.goto(0,-100) 
42 
43 turtle.pendown() 
44 
45 turtle.circle(100)
46 
47 turtle.color("purple")
48 
49 turtle.pensize(40)
50               

 

4个同心圆

标签:style   circle   pytho   turtle   nbsp   import   end   gre   bsp   

原文地址:http://www.cnblogs.com/zj123-/p/6707026.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!