Drawing a letter using circles in python turtle

Question:

I’d like to draw two letters using circles in turtle module.

screenshot showing a letter "c" drawn with circles

I would like to get such a result, but with the letters "T" and "S". How can this be done?

Answers:

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)

T drawing

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')

S drawing

Answered By: Pythoneer
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.