娇滴滴的一朵花(Python实现)

简介: 娇滴滴的一朵花(Python实现)

目录


1 娇滴滴的她


2 Python代码实现


1 娇滴滴的她


afa47ae9583f324cfa1e1e37b58480ce.jpg


娇滴滴。双眉敛破春山色。春山色。

为君含笑,为君愁蹙。多情别後无消息。

此时更有谁知得。谁知得。夜深无寐,度江横笛。


2 Python代码实现


15ad10b0f1ba1335f1e02119ca8548c2.png


import turtle
from turtle import *
turtle.title('春天送她一朵小花')
#~~~~~定义画花瓣的函数~~~~~~~·
def drawLeaf():
    begin_fill()
    for i in range(2):
        for i in range(15):
            lt(6)
            fd(5)
        lt(90)
    end_fill()
#~~~主程序开始~~~~~·
speed(0)
pu()
goto(0, -200)
#~~~~~~画花柄~~~~~~~~~~~·
pd()
color('black', 'green')
for i in range(2):
    lt(90)
    fd(100)
    drawLeaf()
    rt(90)
    drawLeaf()
#~~~画花朵~~~~~
lt(90)
fd(130)
color('black', 'red')
for i in range(12):
    drawLeaf()
    lt(360 / 12)
#~~~画花心的圆圈~~~~
pu()
ls(90)
fd(-10)
rt(90)
pd()
color('black', 'yellow')
begin_fill()
circle(10)
end_fill()
hideturtle()


#~~~~~~画花柄~~~~~~~~~~~·

pd()
color('black', 'green')
for i in range(2):
lt(90)
fd(100)
drawLeaf()
rt(90)
drawLeaf()


#~~~画花朵~~~~~

lt(90)
fd(130)
color('black', 'red')
for i in range(12):
drawLeaf()
lt(360 / 12)


#~~~画花心的圆圈~~~~

pu()
ls(90)
fd(-10)
rt(90)
pd()
color('black', 'yellow')
begin_fill()
circle(10)
end_fill()
hideturtle()


相关文章
|
4天前
|
算法 搜索推荐 C语言
Python实现数据结构与算法
【5月更文挑战第13天】学习数据结构与算法能提升编程能力,解决复杂问题,助你面试成功。从选择资源(如《算法导论》、Coursera课程、LeetCode)到实践编码,逐步学习基本概念,通过Python实现栈、队列和快速排序。不断练习、理解原理,探索高级数据结构与算法,参与开源项目和算法竞赛,持续反思与实践,以提升技术能力。
6 0
|
4天前
|
自然语言处理 Python
Python实现词频统计
Python实现词频统计
|
4天前
|
Python
Python实现hellokitty
Python实现hellokitty
65 0
|
4天前
|
存储 Python
Python实现张万森下雪了的效果
Python实现张万森下雪了的效果
40 0
|
5月前
|
人工智能 知识图谱 Python
python实现知识推理,图可达,pydatalog,kanren,sympy
python实现知识推理,图可达,pydatalog,kanren,sympy
67 0
|
6月前
|
Python
python实现贝塔函数
python实现贝塔函数
|
9月前
|
Python
最速下降法—python实现
最速下降法—python实现
106 0
|
9月前
|
Python
一场樱花雨(Python实现)
一场樱花雨(Python实现)
|
11月前
|
Python
用Python实现樱花树
用Python实现樱花树
95 0
|
算法 Python
Hamilton问题求解-最近邻点法和最近插入法(Python实现)
Hamilton问题求解-最近邻点法和最近插入法(Python实现)
395 0
Hamilton问题求解-最近邻点法和最近插入法(Python实现)