A Parsons Problem is type of lesson where students have to solve the activity like a puzzle. All of the blocks you need to get it working are there, but they're all broken up or in
the wrong order. See if you can get them back in the right order, and get the animation or game working again!
(c) Adam Gaweda
Here is a list of Parsons Puzzles that I created for two courses last Fall. There are roughly 3 per topic, though I removed a couple that would need more context/instruction. The later topics
shift focus towards Data Science, but the exercises should be solvable for a CS1 student. Exercises with an * after their name contain a distractor fragment. Feel free to share or convert to
other languages with anyone that requests them.
-
Variables and Functions
-
- Becoming Familiar with Parson Puzzles
-
- Adding Two Numbers*
-
- Difference to 21*
-
-
Conditionals
-
- Largest of Two*
-
- Position of a Point to a Line
-
- Integer within Range*
-
- Checking if Divisible
-
-
Loops
-
- Coin Flip Probability*
-
- Doubling Account Balance
-
- Random Average
-
-
Lists
-
- Shuffling Items in a List
-
- Reverse a String
-
- Dot Product of Two Lists*
-
-
Nested Lists
-
- Creating a New Nested List
-
- Largest Number in Nested List
-
- Average Number in 2D List*
-
-
Recursion
-
- Recursive Binary Search
-
- Recursive Greatest Common Denominator
-
- Recursive Permutation Generator (with helper function)
-
-
Objects
-
-
Dictionaries
-
-
File Handling
-
- Writing Hello World to a File
-
- Importing a Library That Does Not Exist (Exception Handling)
-
- Using CSV DictReader
-
- Writing to a CSV File
-
-
Data Visualization (matplotlib)
-
- Plotting a Gaussian Distribution
-
- Plotting Exponential Growth
-
- Scatterplot Subplots
-
-
Database Queries (using sqlite3)
-
- Getting the Number of Artists
-
- Creating a DataFrame from a Query*
-
- Counting Customers by Country
-
Misc Tips when Building Parson Puzzles
- Find various example code snippets and then convert them to Parsons Puzzles via http://parsons.problemsolving.io/.
-
- One note though is the js-parsons library can crash the webpage when providing feedback on larger exercises or exercises with deep indentation, so I try to keep my source code
below 20 lines and with at most 3 levels of indentation.
- Minimize the number of operations that can be done in any order.
-
- That isn't crucial but may be a little annoying to form a correct solution but not "the correct solution".
Hope these help, Adam Gaweda