python简单代码画皮卡丘-用python画一只可爱的皮卡丘

这段Python代码通过turtle模块绘制了一只可爱的皮卡丘,包括皮卡丘的头部、眼睛、脸颊、鼻子、嘴巴和耳朵等细节。代码通过定义不同的函数来完成各个部分的绘制,最后组合成完整的皮卡丘形象。
摘要由CSDN通过智能技术生成

#!/usr/bin/env python

# -*- coding:utf-8 -*-

from turtle import *

'''

绘制皮卡丘头部

'''

def face(x,y):

"""画脸"""

begin_fill()

penup()

# 将海龟移动到指定的坐标

goto(x, y)

pendown()

# 设置海龟的方向

setheading(40)

circle(-150, 69)

fillcolor("#FBD624")

# 将海龟移动到指定的坐标

penup()

goto(53.14, 113.29)

pendown()

setheading(300)

circle(-150, 30)

setheading(295)

circle(-140, 20)

print(position())

forward(5)

setheading(260)

circle(-80, 70)

print(position())

penup()

goto(-74.43,-79.09)

pendown()

penup()

# 将海龟移动到指定的坐标

goto(-144,103)

pendown()

setheading(242)

circle(110, 35)

right(10)

forward(10)

setheading(250)

circle(80, 115)

prin

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值