turtle库基础练习

  1. 画一组同切圆
    import turtleturtle.shape('turtle')turtle.circle(10)
    turtle.circle(20)
    turtle.circle(30)
    turtle.circle(40)
    turtle.circle(50)
    turtle.circle(60)
    turtle.circle(70)
    turtle.circle(80)turtle.hideturtle()
    turtle.done()

     

  2. 画一组同心圆

    import turtleturtle.shape('turtle')turtle.circle(20)turtle.up()
    turtle.goto(0,-20)
    turtle.down()turtle.circle(40)turtle.up()
    turtle.goto(0,-40)
    turtle.down()turtle.circle(60)turtle.up()
    turtle.goto(0,-60)
    turtle.down()turtle.circle(80)turtle.up()
    turtle.goto(0,-80)
    turtle.down()turtle.circle(100)turtle.up()
    turtle.goto(0,-100)
    turtle.down()turtle.circle(120)turtle.up()
    turtle.goto(0,-120)
    turtle.down()turtle.circle(140)turtle.up()
    turtle.goto(0,-140)
    turtle.down()turtle.circle(160)turtle.hideturtle()
    turtle.done()

     

  3. 画一个五角星

    import turtleturtle.shape('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.hideturtle()
    turtle.done()

     

  4. 画一个黄色实心五角星

    import turtleturtle.shape('turtle')turtle.color('yellow')
    turtle.fillcolor('yellow')turtle.begin_fill()
    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.end_fill()turtle.hideturtle()
    turtle.done()

  5. 画左上角的五颗五角星
    import turtleturtle.shape('turtle')turtle.bgcolor('red')
    turtle.color('yellow')
    turtle.fillcolor('yellow')turtle.up()
    turtle.goto(-330,170)
    turtle.down()
    turtle.begin_fill() turtle.forward(
    150) turtle.right(144) turtle.forward(150) turtle.right(144) turtle.forward(150) turtle.right(144) turtle.forward(150) turtle.right(144) turtle.forward(150) turtle.end_fill()turtle.up() turtle.goto(-130,220) turtle.down()
    turtle.begin_fill() turtle.forward(
    40) turtle.right(144) turtle.forward(50) turtle.right(144) turtle.forward(50) turtle.right(144) turtle.forward(50) turtle.right(144) turtle.forward(50) turtle.end_fill()turtle.up() turtle.goto(-80,200) turtle.down()
    turtle.begin_fill() turtle.forward(
    40) turtle.right(144) turtle.forward(50) turtle.right(144) turtle.forward(50) turtle.right(144) turtle.forward(50) turtle.right(144) turtle.forward(50) turtle.end_fill()turtle.up() turtle.goto(-80,130) turtle.down()
    turtle.begin_fill() turtle.right(
    144) turtle.forward(50) turtle.right(144) turtle.forward(50) turtle.right(144) turtle.forward(50) turtle.right(144) turtle.forward(50) turtle.right(144) turtle.forward(50) turtle.end_fill()turtle.up() turtle.goto(-130,30) turtle.down()
    turtle.begin_fill() turtle.forward(
    40) turtle.right(144) turtle.forward(50) turtle.right(144) turtle.forward(50) turtle.right(144) turtle.forward(50) turtle.right(144) turtle.forward(50) turtle.end_fill()turtle.hideturtle()
    turtle.done()

     

转载于:https://www.cnblogs.com/qisq/p/7509323.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/282414.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

检查你的项目的引用包依赖关系

2019独角兽企业重金招聘Python工程师标准>>> 随着着开发的进展,你的项目越来越大,引用的第三方包越来越多,但如何查看都依赖了哪些包,甚至传递依赖又是怎样? 首先解决这个问题的前提,你的项目需要是maven项目,然后可以做如下设置: 选中项目,右键->ru…

git 项目操作

1 创建本地仓库,克隆远程项目代码到本地仓库2. 当我们在本地写了一些代码之后 , 查看本地仓库状态3. 提交改变到待提交区 git add .4. 提交代码到待推送区 git commit -m "新建项目kuman"5. 将本地代码推送到远程代码仓库 git push origin master:nanle 注: 将本地m…

(二)SpringBoot功能

web开发 spring boot web开发非常的简单,其中包括常用的json输出、filters、property、log等 json 接口开发 在以前的spring 开发的时候需要我们提供json接口的时候需要做那些配置呢 就这样我们会经常由于配置错误,导致406错误等等,spring bo…

----斐波那契数列---eval函数----类递归思想 栈 进出 思想

------------ 斐波那契 数列 ---------------【1&#xff0c;1,2,3,5,8,13,21,34&#xff0c;...】 1 列表方法实现 # l[1,1] # # # while len(l)<20: # # l.append(l[-1]l[-2]) # # print(l) # # while len(l)!4: # l.append(l[-1]l[-2]) # print(l) # 2 …

【招聘(上海)】 .NET 后端工程师

虫虫拜拜&#xff08;https://www.byepest.com/&#xff09;面向城市家庭、连锁餐饮、医疗机构等提供高品质的虫害防治业务&#xff0c;已经拓展到了7个城市&#xff0c;2022年前计划进入22个城市。平台实现盈利&#xff0c;并且具有独特的竞争力&#xff0c;已经获得德国拜耳公…

HybridTime - Accessible Global Consistency with High Clock Uncertainty

Amazon’s Dynamo [9] and Facebook’s Cassandra [13], relax the consistency model&#xff0c;and offer only eventual consistency. Others such as HBase [1] and BigTable [4] offer strong consistency only for operations touching a single partition, but not acr…

公司目前实行的git团队协作方案

1. git init 新建本地仓库2. git clone 项目地址 获取远程master代码3. 在本地master代码上进行开发, 并将修改提交到待推送区4. 开发完, 在本地master分支基础上创建ready分支5. 在本地ready分支上(本地测试分支), 拉取并合并远程nanle分支最新代码(远程测试分支)6. 将本地re…

bzoj3122 [Sdoi2013]随机数生成器(bsgs+扩欧+数列)

Description Input 输入含有多组数据&#xff0c;第一行一个正整数T&#xff0c;表示这个测试点内的数据组数。 接下来T行&#xff0c;每行有五个整数p&#xff0c;a&#xff0c;b&#xff0c;X1&#xff0c;t&#xff0c;表示一组数据。保证X1和t都是合法的页码。 注意&…

边写 Javascript 代码边玩游戏 – WarriorJS

在 github 上看到这个有趣的项目 – WarriorJS &#xff0c;项目的内容写着 – 令人兴奋的程序设计和人工智慧游戏&#xff0c;Ok 我坦白我是看到人工智慧被这个专案所吸引&#xff0c;但是玩了两个关卡&#xff0c;还是不知道这个游戏跟人工智慧有什么关系&#xff0c;不过这个…

挑选合适自己的一门编程语言

2019独角兽企业重金招聘Python工程师标准>>> 导读想学编程的原因有很多&#xff0c;你也许是想要做一个程序&#xff0c;又或者你只是想投身于这个行业&#xff0c;所以&#xff0c;在选择你的第一门编程语言之前&#xff0c;问问你自己&#xff1a;你想要在哪里运行…

css 实现章节名称不换行,多余部分用 ... 代替

修改之前:修改之后: 代码: <p style "white-space: nowrap;text-overflow: ellipsis;overflow: hidden;"><? $d[name] ?></p> <i><? $d[pen_name] ?></i> <i><?phpforeach ($d[tags] as $t) {echo $t[tag_name];…

.NET 反向代理-YARP 部署Https(SSL)

相关文章&#xff1a;.NET 反向代理-YARP.NET 反向代理-YARP 根据域名转发分享一个基于Abp 和Yarp 开发的API网关项目使用 Yarp 做网关YARP&#xff08;Yet Another Reverse Proxy&#xff09;是使用 .NET 构建的高度可定制的反向代理C# 开源一个基于 yarp 的 API 网关 Demo&am…

shell脚本--cut命令

bash&shell系列文章&#xff1a;http://www.cnblogs.com/f-ck-need-u/p/7048359.html 1.1 选项说明 cut命令将行按指定的分隔符分割成多列&#xff0c;它的弱点在于不好处理多个分隔符重复的情况&#xff0c;因此经常结合tr的压缩功能。 -b&#xff1a;按字节筛选&#xff…

12C RAC for ASM添加磁盘步骤

RHEL 7.2使用EMC Powerpath扩容2T磁盘空间&#xff0c;需要添加至以用12C RAC for ASM系统中。下面是具体步骤&#xff0c;主机人员告知扩容别名为data_center_16、data_center_17 1&#xff1a;linux 7 系统下添加映射存储LUN(无需重启)1>查看机器HBA卡信息--两个节点机器都…

Windows 下 Redis 的下载和安装

一 安装redis 1. 下载redis https://github.com/MicrosoftArchive/redis/releases 注: 如果上面网址下载不了, 就到这里下载 https://download.csdn.net/download/m_nanle_xiaobudiu/104370342. 解压压缩文件夹3. 运行redis服务端到此 , redis已经可以正常使用了,但是为了方便…

什么是行内块元素?

2019独角兽企业重金招聘Python工程师标准>>> 我们都知道行内元素和块级元素&#xff0c;在实际开发中&#xff0c;经常会听到行内块元素&#xff0c;那么什么是行内块元素呢&#xff1f; 行内块元素实际就是把块元素以行的形式展现,保留了块元素可以设置的对应CSS属…

WPF-08 控件模板

模板是描述控件外观&#xff0c;WPF中每个控件都有一个默认的模板&#xff0c;你可以通过定义模板来重写控件可视化外观和行为&#xff0c;WPF中有两种常用的模板Control Template和Data TemplateControl Template控件模板定义了控件的可视化外观&#xff0c;所有的UI控件都有自…

玄学搜索\随稽化

正解又不会写&#xff0c;又懒得去想 只好每次考试大大暴力&#xff0c;维持一下生活了 ----------------------- P1337 [JSOI2004]平衡点 / 吊打XXX 题目描述 有n个重物&#xff0c;每个重物系在一条足够长的绳子上。每条绳子自上而下穿过桌面上的洞&#xff0c;然后系在一起。…

第0次作业

问题1:你为什么选择计算机专业&#xff1f;你认为你的条件如何&#xff1f; 答:我平时比较喜欢研究一些自己认为神秘的东西&#xff0c;我认为计算机就是这样的神秘东西&#xff01;所以我选择这个专业&#xff01;我认为我自己可以学会计算机这个专业&#xff01;我对自己有信…

Nginx +Tomcat 实现动静态分离(转)

Nginx Tomcat 实现动静态分离 动静态分离就是Nginx处理客户端的请求的静态页面(html页面)或者图片&#xff0c;Tomcat处理客户端请求的动态页面&#xff08;jsp页面&#xff09;&#xff0c;因为Nginx处理的静态页面的效率高于Tomcat。 一&#xff0e;Nginx简介&#xff1a; Ng…