1 Figure 1
The first figure is a mosquito, interested parties can try to draw it themselves in python with the turtle library.
The specific code is as follows:
#Painted Mosquitoes import turtle (30) for i in range(30): (i*10,60) ()
2 Figure 2
The second figure is a variant of the mosquito graph, how to draw the following graph by adjusting the mosquito code and changing the color and shape?
The specific code is as follows:
import turtle t = () (2) ('violet') for i in range(90): (i*1,60)
3 Figure 3
The third image is a spiderweb image, but different parts have different colors, so you can try changing it to something else as well.
The specific code is as follows:
#Drawing spider webs from turtle import * speed(0) t = 1 for i in range(100): if t == 1: color('darkviolet') fd(2*i) rt(61) t += 1 elif t == 2: color('green') fd(2*i) rt(61) t += 1 else: color('yellow') fd(2*i) rt(61) t = 1
4 Figure 4
The fourth figure is the Olympic rings.
The specific code is as follows:
#Drawing the Olympic Rings import turtle (5)# Control brush width colors = ['blue', 'black', 'red', 'yellow', 'green'] for i in range(5): (colors[i])# Control brush colors (50)# Control the size of the circle, radius ()# Let the brush lift if i<=1: ((i+1)*120,0) () elif i==2: (60,-30) () elif i==3: (180,-30) () else: ('green') (50) ()
5 Figure 5
The fifth figure is the five-star red flag.
The specific code is as follows:
#Drawing the Five Star Red Flag import turtle as t (600,400,0,0) ("red") ("yellow") ('yellow') (5) t.begin_fill() () (-280,100) () for i in range (5): (150) (144) t.end_fill() t.begin_fill() () (-100,180) (305) () for i in range (5): (50) (144) t.end_fill() t.begin_fill() () (-50,110) (30) () for i in range (5): (50) (144) t.end_fill() t.begin_fill() () (-40,50) (5) () for i in range (5): (50) (144) t.end_fill() t.begin_fill() () (-100,10) (300) () for i in range (5): (50) (144) t.end_fill() () ()
Some of the diagrams in this article also have some code on the internet, so you can all refer to them and think of other interesting ways to draw them.
to this article on the python-turtle library to achieve the drawing of the article is introduced to this, more related python turtle library drawing content please search for my previous posts or continue to browse the following related articles I hope you will support me in the future!