白又白用Python制作了一个奇奇怪怪的月饼送给大家,祝中秋节快
2021-09-06 本文已影响0人
悦悦学Python
前言
效果展示
工具使用
开发工具:pycharm
开发环境:python3.7, Windows10使用工具包:turtle
学习思路解析
def huabian(): goto(0,0) turtle.color("orange") for _ in range(20): turtle.right(18) turtle.begin_fill() turtle.forward(220) turtle.circle(40,180) turtle.goto(0,0) turtle.right(180) turtle.end_fill()
def yuan(): turtle.color("#8fdb75") goto(0,-200) turtle.begin_fill() turtle.circle(200) turtle.end_fill()
def huabian(): goto(0,0) turtle.color("orange") for _ in range(20): turtle.right(18) turtle.begin_fill() turtle.forward(220) turtle.circle(40,180) turtle.goto(0,0) turtle.right(180) turtle.end_fill()
简易源码分享
import turtledef goto(x,y): turtle.penup() turtle.goto(x,y) turtle.pendown()def yuan(): turtle.color("#8fdb75") goto(0,-200) turtle.begin_fill() turtle.circle(200) turtle.end_fill()def huabian(): goto(0,0) turtle.color("orange") for _ in range(20): turtle.right(18) turtle.begin_fill() turtle.forward(220) turtle.circle(40,180) turtle.goto(0,0) turtle.right(180) turtle.end_fill()def neitu(): turtle.color("#D1C185") goto(0,-25) for _ in range(12): turtle.begin_fill() turtle.circle(150,60) turtle.left(90) turtle.circle(150,60) turtle.end_fill()def wirte(): goto(-40,-20) turtle.color("orange") turtle.write('\n\n清馨\n榴莲',font=('Time',30,'bold')) turtle.done()if __name__ == '__main__': turtle.speed(20) huabian() yuan() neitu() wirte()turtle.done()
我是白又白i,一名喜欢分享知识的程序媛❤️
如果没有接触过编程这块的朋友看到这篇博客,发现不会编程或者想要学习的,可以直接留言+私我呀~【非常感谢你的点赞、收藏、关注、评论,一键四连支持】