用python的turtle库画一个python的logo

用python的turtle库画一个python的logo


代码如下(示例):

在这里插入图片描述

import turtle as t
t.colormode(255)
t.speed(10)
t.pensize(3)
t.pu()
t.goto(-200,105)
# 蓝色区域
t.pencolor(54,110,157)
t.fillcolor(54,110,157)
t.begin_fill()
t.goto(-225,-115)
t.pd()
t.seth(90)
t.fd(55)
t.circle(-50,90)
t.fd(190)
t.circle(50,90)
t.fd(100)
t.circle(85,90)
t.fd(100)
t.circle(85,90)
t.fd(30)
t.left(90)
t.fd(150)
t.seth(270)
t.fd(20)
t.right(90)
t.fd(220)
t.circle(50,90)
t.fd(105)
t.circle(50,90)
t.fd(50)
t.left(90)
t.end_fill()
t.fillcolor(255,255,255)
t.pu()
t.goto(-125,155)
t.pd()
t.pencolor(255,255,255)
t.begin_fill()
t.circle(20,360)
t.end_fill()
# 黄色区域
t.pu()
t.goto(85,80)
t.pd()
t.pencolor(255,212,69)
t.fillcolor(255,212,69)
t.begin_fill()
t.seth(270)
t.fd(55)
t.circle(-50,90)
t.fd(190)
t.circle(50,90)
t.fd(100)
t.circle(85,90)
t.fd(100)
t.circle(85,90)
t.fd(30)
t.left(90)
t.fd(150)
t.right(90)
t.fd(20)
t.right(90)
t.fd(220)
t.circle(50,90)
t.fd(105)
t.circle(50,90)
t.fd(50)
t.end_fill()
t.fillcolor(255,255,255)
t.pu()
t.goto(-10,-180)
t.pd()
t.pencolor(255,255,255)
t.begin_fill()
t.circle(20,360)
t.end_fill()
t.done()

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值