January 11 - Python Turtle Drawing Library

Southwest Coder Dojo


Southwest Coder Dojo is a member of Coder Dojo International, an organization of free, volunteer-led coding clubs. We were founded to provide introductory coding experiences for youth and teens (ages 11-18). Our volunteer mentors are software developers and software industry professionals from the Twin Cities.

Register with Hennepin County Library to attend our Dojo events. Tickets are free, but seats are limited. No experience in programming required. Remember to bring your laptop!



This week we used the https://trinket.io/ free online coding playground to get an introduction to the Python programming language. Python is great for backend web development, data sciences, and computing. To get our feet wet, we started with a drawing library called Turtle.

Check out the documentation for Turtle Graphics:
https://docs.python.org/3.3/library/turtle.html?highlight=turtle

Part 1:  Getting started with Python Turtle drawing library 

Investigate:
  1. Connect the two dots with a yellow line
  2. Draw a green dot in the center of the bottom left quadrant
  3. Make the dots bigger or smaller
  4. Draw a square connecting 4 dots (use different colors for each side of the square)
  5. Instead of a ‘dot’, draw a ‘circle’
  6. Print the coordinates of the bottom corners of the square
  7. Print the coordinates of the midpoints of the sides of the square
Part 2: Add to this Trinket that draws a stick person


Investigate: 
  1. Make the pen draw faster or slower 
  2. Draw two eyes (circular or dotted) and a mouth on the person
  3. Draw a hat on the person
  4. What do “forward” and “backward” do?
  5. What about “right” and “left” ?
  6. Fill in the hat with any color you choose  
    • *Hint: myPen.begin_fill()  and myPen.end_fill