Learn to code by tinkering

September 30, 2015 by wendy

Python Turtle Program
epicness by Delta MakerLab summer camper

I recently came across a paper written by Mitchel Resnick, head of the Scratch team, and Eric Rosenbaum, co-creator of MaKeyMaKey, called “Designing for Tinkerability” that caught my attention. It made me wonder. What is tinkering? Why is it important? And are there tools that teach coding which promote tinkering? Let’s find out!

What is tinkering?

According to Resnick and Rosenbaum, tinkering is playful, experimental, and iterative. It allows the learner to constantly explore, try new ideas, and refine their work. Instead of starting at the top with a concrete goal and working their way down, tinkerers start at the bottom by experimenting with different possibilities and work their way up to their goal.

Why is tinkering important?

Tinkering is important because it promotes creative thinking and resilience. Tinkerers learn to iterate, adapt, and take risks. It may seem like tinkering is aimless and tinkerers don’t fully understand what’s happening, but as Resnick and Rosenbaum point out, they understand bits and pieces that will eventually fit into a bigger picture.

Tinkerable coding tools

For a tool to be tinkerable, Resnick and Rosenbaum say that it must incorporate three key principles: immediate feedback, fluid experimentation, and open exploration. Here are a few websites that encourage tinkering for you to try.

  • Scratch – Scratch definitely implements all three principles. When coding in Scratch, you can click on blocks to immediately see what they do, it’s easy to get started, and you can create and share a variety of different projects.
  • Trinket – When writing a Python program in Trinket, you can click on the run button to see what your program does. You can also import modules like Turtle to build different kinds of projects. If you combine Trinket with Code Club projects, it’s also really easy to get started.
  • Thimble – Thimble by Mozilla is an online editor that allows you to create your own webpages. When you type in the editor on the left side of your screen, the preview of your webpage on the right updates straight away. They also have projects that you can remix into your own version so that you can get started quickly.

Python for Kids (and Adults!)

July 20, 2015 by wendy

Python for Kids
Python for Kids by Garrett Heath is licensed under CC by 2.0

Whether you’re looking for a coding project for your child or yourself, Python might be right for you! This week, we’re taking another break from our Teacher’s Guide to Scratch to give you some tips on how to get started with Python.

Why learn Python?

If your child has already mastered drag-and-drop programming, like Scratch or Hopscotch, then Python is the perfect next step. If you’re a grown-up and you want to learn how to program, then Python is also the perfect place to start.

Programmers love Python because it’s easy to read and write. You write less code in Python than in other languages because it has fewer symbols and its rules are less strict. In other words, Python is easier to learn!

How to learn Python

A book can be a good place to start. Python for Kids: A Playful Introduction to Programming explains key programming concepts and has lots of examples. I started reading this book and liked the step-by-step instructions on how to get started, but for me, it eventually covered too much information for a beginner when I just wanted to play.

Luckily, in Chapter 4, it introduced Turtle, a Python module that allows you to draw on the screen. Turtle was actually part of the original Logo programming language back in the 1960s!

Installing Python

IDLE Python Shell

Before you start coding, you’ll need to install Python. Visit the Python website to download the latest version and run the installer. Once Python is installed, look for IDLE on your computer and run it. IDLE is where you’ll write and run your Python programs.

Drawing with Turtle

Python Drawing Square

Within the IDLE Python Shell, enter the following lines of code to load the Turtle module and to create your turtle. I’m calling my turtle Frank, but you can choose any name you like.

>>> import turtle
>>> frank = turtle.Turtle()

Hopefully, a new window popped up called Python Turtle Graphics with a small triangle in the centre. That’s your turtle! Enter these commands to draw a square:

>>> frank.forward(100)
>>> frank.left(90)
>>> frank.forward(100)
>>> frank.left(90)
>>> frank.forward(100)
>>> frank.left(90)
>>> frank.forward(100)
>>> frank.left(90)

Change the values or parameters inside the parentheses to see what they do. For more commands or functions, check out the Turtle documentation on the Python website. In the meantime, experiment with these:

>>> frank.backward(100)
>>> frank.right(90)
>>> frank.reset()
>>> frank.clear()
>>> frank.up()
>>> frank.down()
>>> frank.pencolor("red")
>>> frank.pensize(5)
>>> frank.circle(100)

Saving your work

Rather than writing your programs in the Python Shell, you can go to File, and click on New File, which will open a new window. When you write your program in the new window, you can save your program and run it by selecting Run and Run Module.

Taking next steps

Python Drawing Using Loops

As you become more comfortable with Python and Turtle, incorporate other programming concepts, like loops, to draw more complex designs. Look for examples online, try them out, make them your own, and have fun!