for循环:用turtle画一颗五角星
import turtle
# 设置初始位置
turtle.penup()
turtle.left(90)
turtle.fd(200)
turtle.pendown()
turtle.right(90) # 花蕊
turtle.fillcolor("red")
turtle.begin_fill()
turtle.circle(10, 180)
turtle.circle(25, 110)
turtle.left(50)
turtle.circle(60, 45)
turtle.circle(20, 170)
turtle.right(24)
turtle.fd(30)
turtle.left(10)
turtle.circle(30, 110)
turtle.fd(20)
turtle.left(40)
turtle.circle(90, 70)
turtle.circle(30, 150)
turtle.right(30)
turtle.fd(15)
turtle.circle(80, 90)
turtle.left(15)
turtle.fd(45)
turtle.right(165)
turtle.fd(20)
turtle.left(155)
turtle.circle(150, 80)
turtle.left(50)
turtle.circle(150, 90)
turtle.end_fill() # 花瓣1
turtle.left(150)
turtle.circle(-90, 70)
turtle.left(20)
turtle.circle(75, 105)
turtle.setheading(60)
turtle.circle(80, 98)
turtle.circle(-90, 40) # 花瓣2
turtle.left(180)
turtle.circle(90, 40)
turtle.circle(-80, 98)
turtle.setheading(-83) # 叶子1
turtle.fd(30)
turtle.left(90)
turtle.fd(25)
turtle.left(45)
turtle.fillcolor("green")
turtle.begin_fill()
turtle.circle(-80, 90)
turtle.right(90)
turtle.circle(-80, 90)
turtle.end_fill() turtle.right(135)
turtle.fd(60)
turtle.left(180)
turtle.fd(85)
turtle.left(90)
turtle.fd(80) # 叶子2
turtle.right(90)
turtle.right(45)
turtle.fillcolor("green")
turtle.begin_fill()
turtle.circle(80, 90)
turtle.left(90)
turtle.circle(80, 90)
turtle.end_fill() turtle.left(135)
turtle.fd(60)
turtle.left(180)
turtle.fd(60)
turtle.right(90)
turtle.circle(200, 60)
turtle.write('I love you!', font=("Microsoft JhengHei", 24))
turtle.hideturtle()
turtle.done()
import turtle
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.right(144)
turtle.done()

import turtle
turtle.setup(600,300,0,0)
turtle.bgcolor('yellow') turtle.color("red")
turtle.fillcolor("red")
turtle.begin_fill() for i in range(5): turtle.forward(50) turtle.right(144) turtle.end_fill() turtle.done()

for循环:用turtle画一颗五角星的更多相关文章
- for循环:用turtle画一颗五角星2
import turtle turtle.setup(600,400,0,0) turtle.bgcolor('red') turtle.pencolor('yellow') turtle.fillc ...
- 【Python】【demo实验29】【练习实例】【使用turtle画五角星】
原题: 使用turtle画五角星: 我的代码: #!/usr/bin/python # encoding=utf-8 # -*- coding: UTF-8 -*- from turtle impor ...
- python运用turtle 画出汉诺塔搬运过程
python运用turtle 画出汉诺塔搬运过程 1.打开 IDLE 点击File-New File 新建立一个py文件 2.向py文件中输入如下代码 import turtle class Stac ...
- python3 turtle 画国际象棋棋盘
python3 turtle 画国际象棋棋盘 #!/usr/bin/env python # -*- coding:utf-8 -*- # Author:Hiuhung Wan import turt ...
- day 03 turtle 画鹅
turtle 画鹅 import turtle t=turtle turtle.speed(10) t. setup(800,600) #画头 turtle.penup() turtle.goto(0 ...
- *【Python】【demo实验31】【练习实例】【使用turtle画小猪佩奇】
如下图小猪佩奇: 要求使用turtle画小猪佩奇: 源码: # encoding=utf-8 # -*- coding: UTF-8 -*- # 使用turtle画小猪佩奇 from turtle i ...
- python3 turtle画正方形、矩形、正方体、五角星、奥运五环
python3 环境 turtle模块 分别画出 正方形.矩形.正方体.五角星.奥运五环 #!/usr/bin/env python # -*- coding:utf-8 -*- # Author:H ...
- python之turtle使用:画一颗美美哒的树
关于工具介绍这里小生就不赘述了,这里附上个人觉得最详细的文档地址:https://docs.python.org/zh-cn/3/library/turtle.html?highlight=turtl ...
- 从零开始学习PYTHON3讲义(十二)画一颗心送给你
(内容需要,本讲使用了大量在线公式,如果因为转帖网站不支持公式无法显示的情况,欢迎访问原始博客.) <从零开始PYTHON3>第十二讲 上一节课我们主要讲解了数值计算和符号计算.数值计算的 ...
随机推荐
- word20170106在机场 At the airport有用的词和句子
有用的词: airport terminal: 航站楼 domestic flight: 国内航班 international flight: 国际航班 checked luggage: 托运行李 c ...
- 感受野RF的计算
参考博客:https://blog.csdn.net/wgx571859177/article/details/80983043 设第N层的感受野为N_RF,卷积核尺寸为kernel_size,步长为 ...
- C++关于string的一些用法
#include <iostream> #include <algorithm> #include <functional> using namespace std ...
- 简单python接口测试编写和django开发环境的搭建
安装django环境 启动django D:\python\imooc>python manage.py runserver 0.0.0.0:8000 命令行下django新建app D:\py ...
- Debug Dump file
dump file is a snapshot of the processs memeory. to debug it, we need use its corresponding executiv ...
- 解决SecureCRT中文版"数据库里没找到防火墙'无'"的错误提示
问题描述: 最近从同事那拷贝到一个中文版的SecureCRT,但是每次打开都会有个防火墙的错误提示,“数据库里没找到防火墙“无”.此会话将尝试不通过防火墙进行连接. 出现这个错误的原因是在Secure ...
- 个人NABCD
采用NABCD模型对我们的团队项目大学生失物招领平台进行了详细的需求分析说明,其中N指(Need需求),A (Approach 做法),B (Benefit好处),C (Competitors 竞争) ...
- 六 java和Tomcat
Java企业级应用TOMCAT实战 http://blog.oldboyedu.com/java-tomcat/ 老男孩笔记 常规应用架构模型 Tomcat对静态请求效率低,可以做动静分离,动态的给T ...
- swoole websocket服务推送
用过workerman, 两个字"好用",对于swoole最近有时间也研究研究 swoole的websocket 很好实现 如官网 https://wiki.swoole.com/ ...
- eclipse使用lombok简化java代码
可以利用注解来代替getter.setter.toString.hashCode.构造方法等,简化代码开发. 具体用法 https://www.cnblogs.com/qnight/p/8997493 ...
