Ejemplo de uso de la biblioteca de tortugas de Python

Le asigné una tarea a mi novia para hacer dibujos con tortuga, y elegí el pinguino

# -*- coding: utf-8 -*-
"""
Created on Mon Jan 31 11:33:08 2022

@author: 18705
"""

#企鹅logo.py
import turtle as t
t.penup()
t.fd(150)
t.left(90)
t.fd(90)
t.right(90)
t.pendown()
t.fillcolor(0,0,0)
t.begin_fill()
t.pensize(1)
t.pencolor("black")
t.left(90)
t.circle(150,180)
t.fd(49)
t.seth(-125)
t.fd(49)
t.circle(240,30)
t.circle(20,130)
t.fd(35)
t.seth(-70)
t.circle(165,140)
t.seth(-40)
t.fd(35)
t.circle(20,130)
t.circle(240,30)
t.fd(49)
t.end_fill()

t.penup()
t.seth(180)
t.fd(35)
t.seth(-85)
t.fd(42)
t.pendown
t.fillcolor(1,1,1)
t.begin_fill()
t.pensize(1)
t.pencolor("white")
t.circle(-175,30)
t.fd(20)
t.circle(-175,20)
t.circle(-90,70)
t.circle(-170,40)
t.fd(20)
t.circle(-170,40)
t.end_fill()

t.penup()
t.seth(0)
t.fd(298)
t.seth(90)
t.fd(38)
t.pendown()
t.fillcolor(1,0,0)
t.begin_fill()
t.pensize(1)
t.pencolor("red")
t.seth(-145)
t.circle(-265,70)
t.circle(10,100)
t.fd(28)
t.circle(14,70)
t.circle(245,15)
t.seth(-95)
t.fd(70)
t.circle(14,60)
t.seth(-5)
t.fd(50)
t.circle(14,50)
t.circle(14,50)
t.seth(85)
t.fd(50)
t.seth(-13)
t.circle(250,55)
t.circle(14,70)
t.fd(15)
t.circle(20,75)
t.end_fill()
t.pendown()

 

Supongo que te gusta

Origin blog.csdn.net/m0_57491181/article/details/125537057
Recomendado
Clasificación