1. 程式人生 > >Python基礎綜合練習

Python基礎綜合練習

img OS 綜合 fill .com inf tle rtl 基礎

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基礎綜合練習