猫史档案馆


【Python作品分享】母亲节作品【教程贴】

用户:G_W_LG_W_L查看:0 回复:0 评论:0 创建时间:2020-05-10T13:23:45


【作品展示】

center_image

 

【作品介绍】

母亲节作品,不喜勿喷

可以看看哦

 

【作品源代码】

import turtle
import random
import time

__Pen = turtle.Pen()


__Pen.pencolor('red')
__Pen.penup()
__Pen.backward(300)
__Pen.setheading((-90))
__Pen.forward(350)
__Pen.write('❤', font = ('Arial', 500, 'normal'))
__Pen.setheading(90)
__Pen.forward(350)
__Pen.penup()
__Pen.forward(50)
__Pen.right(90)
__Pen.forward(250)
__Pen.pencolor("#330033")
__Pen.write('妈妈,母亲节快乐!', font = ('Arial', 20, 'bold'))

def function1():

    for __count in range(1):
        __Pen.goto(random.randint((-350), 350), random.randint((-350), 350))
        __Pen.pencolor("#ff6666")
        __Pen.write('❀', font = ('Arial', 25, 'normal'))

def function2():

    for __count in range(1):
        turtle.bgcolor("#99ffff")
        function1()
        time.sleep(0.5)
        turtle.bgcolor("#33ffff")
        function1()
        time.sleep(0.5)
        turtle.bgcolor("#66ffff")
        function1()
        time.sleep(0.5)
        turtle.bgcolor("#33ccff")
        function1()
        time.sleep(0.5)
        turtle.bgcolor("#66cccc")
        function1()
        time.sleep(0.5)

for __count in range(200):
    function2()
turtle.done()

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页