码迷,mamicode.com
首页 > 编程语言 > 详细

Python基础综合练习

时间:2018-03-19 13:36:24      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:from   imp   blog   pos   com   tle   图片   star   基础   

 1 import turtle
 2 from turtle import *
 3 
 4 
 5 def mygoto1(x, y):
 6     turtle.up()
 7     turtle.goto(x, y)
 8     turtle.down()
 9 
10 
11 def star(r):
12     turtle.begin_fill()
13     for i in range(5):
14         turtle.forward(r)
15         turtle.right(144)
16     turtle.end_fill()
17 
18 
19 turtle.setup(700, 500)
20 turtle.bgcolor(red)
21 turtle.color(yellow)
22 turtle.speed(8)
23 turtle.fillcolor(yellow)
24 turtle.hideturtle()
25 
26 
27 mygoto1(-300, 150)
28 star(100)
29 mygoto1(-190, 220)
30 star(45)
31 mygoto1(-140, 150)
32 star(45)
33 mygoto1(-140, 90)
34 star(45)
35 mygoto1(-190, 40)
36 star(45)
37 done()

技术分享图片

Python基础综合练习

标签:from   imp   blog   pos   com   tle   图片   star   基础   

原文地址:https://www.cnblogs.com/liangyao111/p/8600903.html

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