Skip to content
Utah Community Learning

Practice corner

Open to everyone. Play as a guest, scores stay on your device.

Python Basics: Match the Code to the Idea

0/8 matched
Getting Set Up Without Spending a Dime — check yourself1 of 10

You just installed Python and opened up your text editor. You want to write a program that prints your name. What do you type?

Variables: Boxes You Put Stuff In — check yourself1 of 11

You write `name = "Sarah"` in Python. What is the **type** of the value stored in the `name` variable?

Talking to the Program — check yourself1 of 10

You write `print("Hello")` and nothing shows up. What's the most likely reason?

Basic Logic: If This, Then That — check yourself1 of 10

You're writing a program that checks if someone can vote. The rule is: you need to be 18 or older. Which comparison operator do you use? ```python age = 21 if age __ 18: print("You can vote") ```

Loops: Making the Computer Do the Boring Part — check yourself1 of 10

You want to print the numbers 1 through 5, each on its own line. Which loop type is the best choice here?

Putting It Together and Not Losing Your Mind — check yourself1 of 11

You're running a Python script and you get this error: `NameError: name 'user_input' is not defined`. What's the most likely thing that happened?