python的皮卡丘如何写代码,用python皮卡丘的代码

这篇具有很好参考价值的文章主要介绍了python的皮卡丘如何写代码,用python皮卡丘的代码。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

大家好,小编为大家解答python的皮卡丘如何写代码的问题。很多人还不知道python皮卡丘字符打印代码,现在让我们一起来看看吧!

python皮卡丘代码,python

一、哆啦A梦

python皮卡丘代码,python

由于代码过长,这里仅显示部分代码:

from turtle import \*
import turtle as t
from random import \*

#五轨迹跳跃
def my\_goto(x,y):
    penup()
    goto(x,y)
    pendown()

def eyes():
    fillcolor('#ffffff')
    begin\_fill()

    tracer(False)
    a \= 2.5
    for i in range(120):
        if 0<= i<30 or 60 <= i <90:
            a \-= 0.05
            lt(3)
            fd(a)
        else:
            a += 0.05
            lt(3)
            fd(a)
    tracer(True)
    end\_fill()

#胡须
def beard():
    my\_goto(\-32,135)
    seth(165)
    fd(60)

    my\_goto(\-32,125)
    seth(180)
    fd(60)

    my\_goto(\-32,115)
    seth(193)
    fd(60)

    my\_goto(37,135)
    seth(15)
    fd(60)

    my\_goto(37,125)
    seth(0)
    fd(60)

    my\_goto(37,115)
    seth(\-13)
    fd(60)

#嘴巴
def mouth():
    my\_goto(5,148)
    seth(270)
    fd(100)
    seth(0)
    circle(120,50)
    seth(230)
    circle(\-120,100)

二、海绵宝宝

python皮卡丘代码,python

部分代码如下:

from turtle import \*

def go\_to(x, y):
    penup()
    goto(x, y)
    pendown()

def help\_do():
    go\_to(\-400, 0)
    forward(800)
    go\_to(\-400, 100)
    forward(800)
    go\_to(\-400,200)
    forward(800)
    go\_to(\-400, -100)
    forward(800)
    go\_to(\-400, -200)
    forward(800)
    left(90)
    go\_to(0,\-300)
    forward(600)
    go\_to(100, -300)
    forward(600)
    go\_to(\-100, -300)
    forward(600)
    go\_to(\-200, -300)
    forward(600)
    go\_to(200, -300)
    forward(600)

def head():
    go\_to(\-200, 180)
    fillcolor('yellow')
    begin\_fill()
    seth(\-30)
    for \_ in range(6):
        circle(36, 60)
        circle(\-36, 60)
    seth(\-125)
    for \_ in range(5):
        circle(40,60)
        circle(\-40,60)
    seth(\-210)
    for \_ in range(4):
        circle(45,60)
        circle(\-45,60)
    seth(65)
    for \_ in range(5):
        circle(40,60)
        circle(\-40,60)
    end\_fill()

三、皮卡丘

python皮卡丘代码,python

部分代码如下:

import turtle

def getPosition(x, y):
    turtle.setx(x)
    turtle.sety(y)
    print(x, y)

class Pikachu:

    def \_\_init\_\_(self):
        self.t \= turtle.Turtle()
        t \= self.t
        t.pensize(3)
        t.speed(9)
        t.ondrag(getPosition)

    def noTrace\_goto(self, x, y):
        self.t.penup()
        self.t.goto(x, y)
        self.t.pendown()

    def leftEye(self, x, y):
        self.noTrace\_goto(x, y)
        t \= self.t
        t.seth(0)
        t.fillcolor('#333333')
        t.begin\_fill()
        t.circle(22)
        t.end\_fill()

        self.noTrace\_goto(x, y \+ 10)
        t.fillcolor('#000000')
        t.begin\_fill()
        t.circle(10)
        t.end\_fill()

        self.noTrace\_goto(x \+ 6, y + 22)
        t.fillcolor('#ffffff')
        t.begin\_fill()
        t.circle(10)
        t.end\_fill()

    def rightEye(self, x, y):
        self.noTrace\_goto(x, y)
        t \= self.t
        t.seth(0)
        t.fillcolor('#333333')
        t.begin\_fill()
        t.circle(22)
        t.end\_fill()

        self.noTrace\_goto(x, y \+ 10)
        t.fillcolor('#000000')
        t.begin\_fill()
        t.circle(10)
        t.end\_fill()

        self.noTrace\_goto(x \- 6, y + 22)
        t.fillcolor('#ffffff')
        t.begin\_fill()
        t.circle(10)
        t.end\_fill()

四、史迪仔

python皮卡丘代码,python

部分代码如下:

from turtle import \*

setup(650,650)
penup()
pensize(5)
speed(1000)
pencolor("#065693")
seth(180)
fd(140)
seth(\-90)
fd(50)
pendown()      #起点
fillcolor("#0079C6")
begin\_fill()
seth(170)
circle(\-40,100)
seth(180)
fd(50)
seth(180)
circle(\-10,46)
seth(130)
circle(\-300,40)#耳朵外廓大圆
circle(-100,45)
right(10)
circle(\-50,30)
right(10)
circle(\-30,30)
left(1)
fd(2)
right(1)
fd(3)
right(4)
fd(3)
right(3)
fd(5)
right(4)
fd(6)
right(4)
fd(10)
right(4)
fd(10)
right(3)
fd(15)
right(2)
fd(20)
right(2)
fd(20)
right(4)
fd(20)
right(3)
fd(30)
right(1)
fd(40)
right(1)
fd(60)
seth(\-115)
fd(5)    #脸左侧开始逆时针
circle(200,30)
end\_fill()
begin\_fill()
left(8)
fd(20)
left(10)
fd(20)
left(14)
circle(100,30)
left(10)
circle(150,20)
right(2)
fd(55)
left(5)
fd(40)
left(3)
fd(25)
right(3)
circle(150,20)
left(7)
circle(100,30)

—— —— —— —— — END —— —— —— —— ————文章来源地址https://www.toymoban.com/news/detail-717930.html

一、哆啦A梦

python皮卡丘代码,python

由于代码过长,这里仅显示部分代码:

from turtle import \*
import turtle as t
from random import \*

#五轨迹跳跃
def my\_goto(x,y):
    penup()
    goto(x,y)
    pendown()

def eyes():
    fillcolor('#ffffff')
    begin\_fill()

    tracer(False)
    a \= 2.5
    for i in range(120):
        if 0<= i<30 or 60 <= i <90:
            a \-= 0.05
            lt(3)
            fd(a)
        else:
            a += 0.05
            lt(3)
            fd(a)
    tracer(True)
    end\_fill()

#胡须
def beard():
    my\_goto(\-32,135)
    seth(165)
    fd(60)

    my\_goto(\-32,125)
    seth(180)
    fd(60)

    my\_goto(\-32,115)
    seth(193)
    fd(60)

    my\_goto(37,135)
    seth(15)
    fd(60)

    my\_goto(37,125)
    seth(0)
    fd(60)

    my\_goto(37,115)
    seth(\-13)
    fd(60)

#嘴巴
def mouth():
    my\_goto(5,148)
    seth(270)
    fd(100)
    seth(0)
    circle(120,50)
    seth(230)
    circle(\-120,100)

二、海绵宝宝

python皮卡丘代码,python

部分代码如下:

from turtle import \*

def go\_to(x, y):
    penup()
    goto(x, y)
    pendown()

def help\_do():
    go\_to(\-400, 0)
    forward(800)
    go\_to(\-400, 100)
    forward(800)
    go\_to(\-400,200)
    forward(800)
    go\_to(\-400, -100)
    forward(800)
    go\_to(\-400, -200)
    forward(800)
    left(90)
    go\_to(0,\-300)
    forward(600)
    go\_to(100, -300)
    forward(600)
    go\_to(\-100, -300)
    forward(600)
    go\_to(\-200, -300)
    forward(600)
    go\_to(200, -300)
    forward(600)

def head():
    go\_to(\-200, 180)
    fillcolor('yellow')
    begin\_fill()
    seth(\-30)
    for \_ in range(6):
        circle(36, 60)
        circle(\-36, 60)
    seth(\-125)
    for \_ in range(5):
        circle(40,60)
        circle(\-40,60)
    seth(\-210)
    for \_ in range(4):
        circle(45,60)
        circle(\-45,60)
    seth(65)
    for \_ in range(5):
        circle(40,60)
        circle(\-40,60)
    end\_fill()

三、皮卡丘

python皮卡丘代码,python

部分代码如下:

import turtle

def getPosition(x, y):
    turtle.setx(x)
    turtle.sety(y)
    print(x, y)

class Pikachu:

    def \_\_init\_\_(self):
        self.t \= turtle.Turtle()
        t \= self.t
        t.pensize(3)
        t.speed(9)
        t.ondrag(getPosition)

    def noTrace\_goto(self, x, y):
        self.t.penup()
        self.t.goto(x, y)
        self.t.pendown()

    def leftEye(self, x, y):
        self.noTrace\_goto(x, y)
        t \= self.t
        t.seth(0)
        t.fillcolor('#333333')
        t.begin\_fill()
        t.circle(22)
        t.end\_fill()

        self.noTrace\_goto(x, y \+ 10)
        t.fillcolor('#000000')
        t.begin\_fill()
        t.circle(10)
        t.end\_fill()

        self.noTrace\_goto(x \+ 6, y + 22)
        t.fillcolor('#ffffff')
        t.begin\_fill()
        t.circle(10)
        t.end\_fill()

    def rightEye(self, x, y):
        self.noTrace\_goto(x, y)
        t \= self.t
        t.seth(0)
        t.fillcolor('#333333')
        t.begin\_fill()
        t.circle(22)
        t.end\_fill()

        self.noTrace\_goto(x, y \+ 10)
        t.fillcolor('#000000')
        t.begin\_fill()
        t.circle(10)
        t.end\_fill()

        self.noTrace\_goto(x \- 6, y + 22)
        t.fillcolor('#ffffff')
        t.begin\_fill()
        t.circle(10)
        t.end\_fill()

四、史迪仔

python皮卡丘代码,python

部分代码如下:

from turtle import \*

setup(650,650)
penup()
pensize(5)
speed(1000)
pencolor("#065693")
seth(180)
fd(140)
seth(\-90)
fd(50)
pendown()      #起点
fillcolor("#0079C6")
begin\_fill()
seth(170)
circle(\-40,100)
seth(180)
fd(50)
seth(180)
circle(\-10,46)
seth(130)
circle(\-300,40)#耳朵外廓大圆
circle(-100,45)
right(10)
circle(\-50,30)
right(10)
circle(\-30,30)
left(1)
fd(2)
right(1)
fd(3)
right(4)
fd(3)
right(3)
fd(5)
right(4)
fd(6)
right(4)
fd(10)
right(4)
fd(10)
right(3)
fd(15)
right(2)
fd(20)
right(2)
fd(20)
right(4)
fd(20)
right(3)
fd(30)
right(1)
fd(40)
right(1)
fd(60)
seth(\-115)
fd(5)    #脸左侧开始逆时针
circle(200,30)
end\_fill()
begin\_fill()
left(8)
fd(20)
left(10)
fd(20)
left(14)
circle(100,30)
left(10)
circle(150,20)
right(2)
fd(55)
left(5)
fd(40)
left(3)
fd(25)
right(3)
circle(150,20)
left(7)
circle(100,30)

—— —— —— —— — END —— —— —— —— ————

到了这里,关于python的皮卡丘如何写代码,用python皮卡丘的代码的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 教你用Python画哆啦A梦、海绵宝宝、皮卡丘、史迪仔!(附完整源码)

       由于代码过长,这里仅显示部分代码:        部分代码如下:       部分代码如下:       部分代码如下:     关注我的原创公众号【 小鸿爱摸鱼 】,回复【可爱皮卡丘】、【哆啦A梦】、【史迪仔】、【海绵宝宝】获取对应的源码     Author:南柯树下,Goa

    2023年04月20日
    浏览(25)
  • 皮卡丘SQL注入汇总

    SQL注入漏洞主要形成的原因是在数据交互中,前端的数据传入到后台处理时,没有做严格的判断,导致其传入的“数据”拼接到SQL语句中后,被当作SQL语句的一部分执行。 从而导致数据库受损(被脱裤、被删除、甚至整个服务器权限沦陷)。 注入攻击是通过将恶意的 Sql 查询

    2024年02月07日
    浏览(23)
  • 皮卡丘靶场搭建遇到的问题大全

    自己电脑开启了mysql服务,使用win+r,services.msc,找到自己的mysql服务,关闭。再次尝试使用phpstudy_pro启动mysql,成功解决。 不存在pikachu数据库,使用小皮创建一个pikachu数据库,用户名,密码随便写。 解决 访问子网页install.php,如我的 解决。

    2024年02月10日
    浏览(23)
  • Web安全 Pikachu(皮卡丘)靶场搭建.

    Pikachu(皮卡丘)是一个自带Web漏洞的应用系统,在这里包含了常见的web安全漏洞。如果你是一个想学习Web渗透测试人员,并且没有找到合适靶场,则可以使用这个Pikachu(皮卡丘)进行练习。( 靶场包含:(1)暴力破解,(2)XSS,(3)CSRF,(4)SQL注入,(5)RCE,(6)文件

    2023年04月17日
    浏览(27)
  • 其实python真的很简单!今天就教会你,用Python画哆啦A梦、海绵宝宝、皮卡丘、史迪仔!附上源码,不信你还学不会!

    由于代码过长,这里仅显示部分代码: 部分代码如下: 部分代码如下: 部分代码如下: —— —— —— —— — END —— —— —— —— ————

    2024年02月07日
    浏览(32)
  • 我让ChatGPT用CSS3画一个皮卡丘,还是自己画的可爱

    突然想到了小时候看过的动画片《皮卡丘》,于是突然就想,ChatGPT肯定也看过,他哪有不知道的东西啊,于是就想着让他帮我画一个,他画出来之后,我笑了,这啥玩意儿啊。   目录 一、第一次尝试让ChatGPT用CSS3画皮卡丘 1. 绘制皮卡丘的耳朵: 2. 绘制皮卡丘的眼睛: 3. 

    2024年02月04日
    浏览(35)
  • 皮卡丘存储型xss、DOM型xss、DOM型xss-x

    看题目,我们先留言,看它的过滤机制 发现可以永久存储并输出我们的留言 之后插入payload: scriptalert(\\\'xss\\\')/script  成功弹窗! Dom型xss,简单的说,就是向文档对象传入xss参数,然后操作文档对象是触发xss攻击 先插入payload:scriptalert(1)/script试试 F12,发现a元素href属性的值改编

    2024年02月08日
    浏览(30)
  • 在手机上如何运行python,手机如何运行python代码

    本篇文章给大家谈谈手机python编程软件怎么运行,以及在手机上如何运行python,希望对各位有所帮助,不要忘了收藏本站喔。 大家好,本文将围绕手机上如何运行python代码展开说明,手机如何运行python代码是一个很多人都想弄明白的事情,想搞清楚手机运行python程序图形需要

    2024年02月04日
    浏览(34)
  • python代码编写规范有哪些,Python如何编写代码运行

    大家好,小编来为大家解答以下问题,编写高质量python代码的59个有效方法,python代码编写规范有哪些,今天让我们一起来看看吧! 大家好,本文将围绕python程序编程代码大全展开说明,python编程游戏代码是一个很多人都想弄明白的事情,想搞清楚python代码大全简单需要先了

    2024年01月19日
    浏览(36)
  • 手机上如何运行python代码,手机如何运行python程序

    大家好,小编来为大家解答以下问题,手机上如何运行python代码,手机如何运行python程序,今天让我们一起来看看吧! 如何用手机编程Python? 1.QPython3:这是一个在安卓手机上运行python3的脚本引擎,整合了python3解释器、控制台、QEdit编辑器和SLA4库,可以在安卓手机上运行p

    2024年02月22日
    浏览(30)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包