Python Turtle – Draw letter K

In this post we will be creating a Python script to draw the letter ‘K’ using the turtle library. The turtle library enables us to a virtual canvas where one can draw an endless number of shapes and pictures. It is especially useful for beginners, children and programmers wanting to have some fun – The library is limited only by imagination.

See the snippet of Python code below where we use the Python turtle library to draw the letter ‘K’. If your interested in drawing a different letter, click here!

import turtle

# Create a turtle object
my_turtle = turtle.Turtle()

# Draw the letter k
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.backward(50)
my_turtle.right(45)
my_turtle.forward(70.7)
my_turtle.backward(70.7)
my_turtle.right(90)
my_turtle.forward(70.7)

# Hide the turtle
my_turtle.hideturtle()

# Keep the window open until it is closed manually
turtle.done()

The above would output the following to a canvas and leave it open.

Python Turtle - Draw letter K

If you do create your own, please do share with us as we would love to see! If your interested in drawing a different letter, click here! Also be sure to check out some of our other Turtle examples here.

Take a look at some of our other content around the Python programming language by clicking here.

One thought on “Python Turtle – Draw letter K

Leave a Reply