I'd like to draw two letters using circles in turtle module.
I would like to get such a result, but with the letters "T" and "S". How can this be done?
I have the code here:
from turtle import *
radius = 20
def t():
x_formation = [((i*25)-115,200) for i in range(10)]
y_formation = [(0,(i*25)-50) for i in range(10)]
def draw_form(formation):
for i in formation:
penup()
goto(i)
pendown()
circle(radius)
draw_form(x_formation)
draw_form(y_formation)
The code for drawing an s
is below:
def s():
def draw_semicircle(direction):
if direction == 'left':
for x in range(9):
penup()
forward(20)
left(-25)
pendown()
circle(radius)
else:
for x in range(7):
penup()
forward(20)
right(25)
pendown()
circle(radius)
draw_semicircle('left')
penup()
goto(40,25)
draw_semicircle('right')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.