首页 > 编程语言 > 详细

Python基础综合练习

时间:2018-03-19 10:06:12      阅读:198      评论:0      收藏:0      [点我收藏+]
import turtle


def mygoto(x, y):
    turtle.up()
    turtle.goto(x, y)
    turtle.down()


def drawwu(x):
    turtle.begin_fill()
    for i in range(5):
        turtle.forward(x)
        turtle.right(144)
    turtle.end_fill()


turtle.setup(600, 400, 0, 00)
turtle.color(yellow)
turtle.bgcolor(red)
turtle.color(yellow)
turtle.speed(10)
mygoto(-300, 95)
drawwu(100)

for i in range(4):
    x = 1
    if i in [0, 3]:
        x = 0
    mygoto(-100 + x * 50, 150 - i * 40)
    turtle.left(15 - i * 15)
    drawwu(50)
turtle.done()
技术分享图片

 

Python基础综合练习

原文:https://www.cnblogs.com/guoyaowen/p/8599886.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!