python绘制立方体

import turtle

turtle.goto(400, 0)
turtle.goto(400, 200)
turtle.goto(0, 200)
turtle.goto(0, 0)

turtle.penup()
turtle.goto(300, 100)
turtle.pendown()

turtle.goto(300, -100)
turtle.goto(-100, -100)
turtle.goto(-100, 100)
turtle.goto(300, 100)

turtle.goto(400, 200)
turtle.penup()
turtle.goto(300, -100)
turtle.pendown()
turtle.goto(400, 0)

turtle.penup()
turtle.goto(-100, -100)
turtle.pendown()
turtle.goto(0, 0)

turtle.penup()
turtle.goto(-100, 100)
turtle.pendown()
turtle.goto(0, 200)

turtle.done()

python绘制立方体_第1张图片

你可能感兴趣的:(python,python)