Python Flashcards

Python is not a bad language to learn how to program a computer, but it’s syntax and layout rules are a bit different from other languages. In the early days, kids in a club will keep asking for regular help decoding what that “SyntaxError” message means. The Python Flashcards are a useful tool to stop you being run ragged.

I put together the python flashcards one evening, as a way to stop a class load of kids keep asking me “why do I get this error” and “what’s wrong with this program” – it allows them to be a bit more self sufficient, and gives me more time to give individual help.

Originally I was going to write a whole suite of sample programs (but I’d already done that with the “simple python programs”). I wanted something quicker and more instant, in a format I could point a finger at and say “look, that’s how you do it”.

So, each flashcard is postcard sized with a tiny working program with just the key concept, a memory jogger on the syntax. Because python is a good “incremental language”, you don’t need much else in the example to make it an actual running program.

I print the flashcards out on stiff card, then keep them together with a small bulldog clip. I can leave the whole pack on the table for the kids to dip into when they get stuck, or sometimes scatter them out on the table so they can see them all at once.

Creative ways to use flashcards

Since making these flashcards, I’ve found lots of ways of applying them in different situations. Here are a few of my favorites:

[1] give the whole stack to a child and get them to work through them one by one

[2] give them to a teacher or a technician, to help them remember the syntax when asked by children

[3] use them as a review technique when checking student progress: work through each one asking the child to show you an example of a “comment” or a “while loop”, and put the card in a “done” pile if they show you a working example in one of their programs. The ones remaining are the areas of the language they need to work on. Get the child to write down in their book the remaining ones they need to study and use next week.

[4] scatter them out randomly on the table in a classroom and get the children to walk over and look through them when they get stuck on the syntax. If they ask you for help, ask them first if they have checked the flashcards.

[5] print and laminate them, punch a hole in the corner, and tie them together with a clip. Give one set out to each child as a pocket prompt to dip into when they get stuck.

[6] stick them all on a huge sheet of paper and make a poster out of them for the classroom wall. Get the children to stick them on and write their own examples on the poster by the side of each card, of things you could use each programming technique for in a real program, to give others ideas.


I have included both the PDF and DOCX formats below – just print the PDF and cut/laminate to use them “as is” – or if you want to edit them to your own needs, feel free to use the DOCX and modify it.

There is a licence to use included with the cards which is very open, so you can create your own card variants from these (see the German translation for an example of this).

[1] PythonFlashcards.pdf      python(1), simple programming (using python2)

[2] PythonFlashcards.docx    python(1), simple programming (using python2)

[3] German version                (kindly done by @christianimmler) (using python2)

[4] Mobile App                        An AppShed app, with python3 content.


There are small differences between python2 and python3 that you should be aware of.

Python2 uses print “hello” for outputting, and name = raw_input(“name?”) for inputting.

Python3 uses print(“hello”) for outputting, and name = input(“name?”) for inputting.

At the moment I am “between versions”, so the printed flashcards are for python2, and the AppShed app is for python3. I will correct this soon.

You have the .docx files above for the printed cards, so it wouldn’t take you too long to modify these yourself if you want python3 syntax.

The main reason you might fall into this trap, is that on a Raspberry Pi, the default python interpreter is python2 – to access GPIO and other hardware, you have to use ‘sudo’ to access the hardware, so you are probably doing this at the command line, and you will get python 2. As most of my early work was done with GPIO, I settled on python2.

However, on the desktop of the Raspberry Pi, there are two versions of the IDLE integrated development environment. IDLE uses python2 and IDLE3 uses python3. It’s all a bit of a mess really, but if you remember the print and raw_input/input differences above, that should be mostly all you need to know to solve this issue yourself.

This entry was posted in Python, Raspberry Pi. Bookmark the permalink.

Comments are closed.