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

Python基础综合练习

时间:2018-03-19 10:25:15      阅读:221      评论:0      收藏:0      [点我收藏+]

标签:gpo   练习   bsp   alt   图片   pytho   分享   color   img   

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基础综合练习

标签:gpo   练习   bsp   alt   图片   pytho   分享   color   img   

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

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