python turtle库的使用示例

给女朋友布置了用turtle画图的作业,选择小企鹅

# -*- 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()

 

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值