用python画玫瑰花代码-Python | 用turtle库画玫瑰花

本文展示了如何使用Python的turtle库创作一个3D效果的玫瑰花图案。通过控制turtle的移动和转向,结合循环与填充颜色,创建出逼真的玫瑰花图形。代码简洁易懂,适合初学者学习。
摘要由CSDN通过智能技术生成

python、turtle库

2019年02月28日 11:46:16

展示效果如下:

3ARZZr.gif 肉丝

代码如下:

from turtle import *

import time

setup(600, 800, 0, 0)

speed(0)

penup()

seth(90)

fd(340)

seth(0)

pendown()

speed(5)

begin_fill()

fillcolor('red')

circle(50, 30)

for i in range(10):

fd(1)

left(10)

circle(40, 40)

for i in range(6):

fd(1)

left(3)

circle(80, 40)

for i in range(20):

fd(0.5)

left(5)

circle(80, 45)

for i in range(10):

fd(2)

left(1)

circle(80, 25)

for i in range(20):

fd(1)

left(4)

circle(50, 50)

time.sleep(0.1)

circle(120, 55)

speed(0)

seth(-90)

fd(70)

right(150)

f

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值