Skip to main content

Section 3 (3/5) Introduction to Parsons Puzzles

Welcome to the Parsons Puzzles practice session! In this section, you will get familiar with how Parsons Puzzles work before attempting the actual test puzzles.
A Parsons Puzzle presents you with all the lines of code needed to solve a programming task, but they are mixed up. Your job is to:
  • Drag the code blocks from the left side to the right side
  • Arrange them in the correct order
  • Set the proper indentation for each line
Let’s start with a simple practice puzzle to get you comfortable with the interface.

Subsection 3.1 Practice Puzzle 1: Simple Function

This is a simple warm-up problem. Try to arrange the code blocks in the correct order to create a function that prints a greeting message.

Question 3.1.1.

Arrange the following code blocks to create a function called greet that takes a name as a parameter and prints "Hello, [name]!"
Tips for solving Parsons Puzzles:
  • Read the problem description carefully
  • Think about the logical flow of the program
  • Pay attention to indentation - it matters in Python!
  • Use the Check button to test your solution
  • Don’t worry if you make mistakes - you can try again

Subsection 3.2 Practice Puzzle 2: Conditional Statement

Now let’s try a slightly more complex problem that involves a conditional statement.

Question 3.2.1.

Arrange the code blocks to create a function called check_positive that takes a number as a parameter and returns True if the number is positive, and False otherwise.

Subsection 3.3 Practice Puzzle 3: With Paired Distractors

This puzzle includes paired distractors. For some steps, you will be presented with a choice between a correct code block and an incorrect one. Your job is to identify and use only the correct block from each pair. This is what you’ll see in the test problems.

Question 3.3.1.

Arrange the code blocks to create a function called is_even that takes a number and returns True if it’s even, False if it’s odd.
Notice: You had to choose the correct line from pairs of correct and incorrect code. In the test, you’ll also need to identify which lines are correct and which are distractors.

Subsection 3.4 Are You Ready?

Great work on the practice problems! You should now be familiar with:
  • How to drag and drop code blocks
  • How to arrange blocks in the correct order
  • How to set proper indentation
  • How to check your solution and interpret feedback

Question 3.4.1.

Do you feel ready to proceed to the actual Parsons Puzzles test?
  • Yes, I’m ready to start the test
  • I need more practice (you can review the puzzles above)
When you’re ready, click the Next button to begin the test section.
Remember: In the test section, you will have four puzzles to solve. Take your time, read each problem carefully, and do your best!