Home > Mobile >  Draw English Alphabet Small letters in Turtle
Draw English Alphabet Small letters in Turtle

Time:05-31

I have just started learning turtle in python. I am tried to draw "a" Letter in python, but I couldn't.

This is my code so far:

from turtle import  *
bgcolor("cyan")
pencolor("steel blue")
speed(1)
pensize(20)

penup()
goto(-30, 50)  # centering in the screen
pendown()
pensize(10)
pencolor("red")

circle(100, None, 150)
forward(70)
circle(-100,-80)

But when I tried to run this code it's not drawing a letter properly.

Could someone please help me on this?

Also, please help me to draw other small letters of English Alphabet.

Thanks in advance!

CodePudding user response:

You're code is very close. To draw a printed lowercase letter 'a', you could do:

from turtle import  *

bgcolor("cyan")
pencolor("steel blue")
speed('slowest')
pensize(20)

penup()
sety(-50)  # center on the screen
pendown()
pensize(10)
pencolor("red")

circle(100, extent=360   90)
forward(100)
backward(200)

hideturtle()
done()

enter image description here

To draw a cursive lowercase letter 'a' would take a little more effort.

As far as drawing an alphabet, you need to work out what is the standard size of your letters. Also make sure you mouse starts and ends at the same relative location for each letter so that your can combine them.

CodePudding user response:

turtle has a function called write which is used to write letters or words
you can do something like this:

import turtle

turtle.color('black')
style = ('Arial', 30, 'italic')
turtle.write('aA', font=style, align='center')
turtle.hideturtle()
turtle.done()```
  • Related