Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use turtle drawing of python to program lion logo

Shulou Source: shulou.com Published: 2022-06-01 20:44:40 10月01日 Update

This article Xiaobian for you to introduce in detail "how to use python turtle drawing programming lion logo", the content is detailed, the steps are clear, the details are handled properly, I hope this "how to use python turtle painting programming lion logo" article can help you solve your doubts, the following follow the editor's ideas slowly in-depth, together to learn new knowledge.

Import turtle as tdef hexagon (): # draw the hexagonal face of a lion And color t.begin_fill () t.right (60) t.forward (210) t.right (60) t.forward (60) t.right (60) t.forward (10) t.right (60) t.forward (60) t.right (60) t.forward (10) t.right (60) t.forward (210) t.end_fill () def face (): # paint the details of the lion's face (think of it as a polygon) t.pensize (2) t.color ("black") "black") t.begin_fill, t.right, t.forward, t.right, t.forward, t.left, t.forward, t.right, t.forward, t.right, t.forward, t.left, t.forward, t.left. Forward t.right (60) t.forward (60) t.left (60) t.forward (50) t.right (55) t.left (90) t.forward (45) t.left (90) t.forward (55) t.right (60) t.forward (50) t.left .right (60) t.forward (105) t.end_fill () def zongmao (): # draw the lion's mane t.begin_fill () t.forward (210) t.left (90) t.circle (210120) t.left (30) t.forward (210) t.left (120) t.forward (210) t.end_fill () t.backward (210) T.left (60) t.penup () t.goto (60180) t.pendown () t.color ("black" "# f9e052") t.pensize (10) hexagon () face () t.penup () t.goto (60180) t.pendown () t.right (30) t.color ("black", "# fe6a00") t.pensize (10) for i in range (6): zongmao () here This article "how to program lion logo with python turtle drawing" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself. If you want to know more about the article, you are welcome to follow the industry information channel.

Tags: Programming articles Lions details content face proper hexagons polygons ideas New knowledge more steps knowledge knowledge points articles Industry Information Information Channel follow Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS MariaDB Redmi Xiaomi Linux