What are Prasons Puzzles?
Parsons programming puzzles are a type of scaffolded program
construction tasks where the learner is given a set of code fragments,
blocks of a single or multiple lines of code,
and the task is to piece together a program from these.
Learners not only select and order but also indent code fragments.
They are challenging problems that reduces the cognitive load
and time spent for students.
This variant of Parsons programming puzzles is called two-dimensional (2D) Parsons problems.
In Python, code indentation has a semantic meaning, as an indented statement falls into
the surrounding control structure, which has lower indentation.
That is, code blocks are deﬁned by indentation instead of start and end symbols like curly braces.
The use of Parsons puzzles is an evidence-based teaching practice.
Write the title and the code of a program in the following form.
#distractor comment at the end of the line to set it as a distractor line.
Click on the Create Puzzle button to generate the puzzle.
You will be redirected to the puzzle page.
That is an example of a puzzle of the function
Copy the URL, and use it as is or embed it as IFrame in your course.
For example, you can embed a puzzle in a Jupyter Notebook code cell with:
from IPython.display import IFrame
IFrame('<puzzle url>', width=1000, height=400)
You can find here a Jupyter Notebook example (you should download and run it locally).
If you plan to embed the Parson puzzle under an
https website (for example, in a JupyterHub server),
you should replace the domain of the puzzle URL. Instead of
So the URL of the previous example would be: https://parsons.herokuapp.com/puzzle/5f25ce927e9449c8af6a5edc295236ab.
- Parsons, D., & Haden, P. (2006, January).
Parson's programming puzzles: a fun and effective learning tool for first programming courses.
In Proceedings of the 8th Australasian Conference on Computing Education-Volume 52 (pp. 157-163).
Australian Computer Society, Inc.
Ihantola, P., & Karavirta, V. (2011).
Two-dimensional parson’s puzzles: The concept, tools, and first observations.
Journal of Information Technology Education, 10, 119-132.
CS Teaching Tips -
Use Parson’s Puzzles
to help students engage with a concept
without writing code or experiencing frustrating syntax errors.