Practice & Test

Test Area

Try what you learned! Eight hands-on labs from simple print() to Turtle โ€” run code, follow commands, and check your work.

Tap a lab below to open it and start coding.

Learning Path

Your mission

  1. Use print() to show text on the screen.
  2. Put your message inside quotes like "Hello".
  3. Try printing your name on a second line.
  4. Run the code and read the console output.
  5. Change the words and run again to see what happens.

Your mission

  1. A variable stores information, like a labeled box.
  2. Create age = 12 and print it.
  3. Create a second variable for your favorite animal.
  4. Print both variables on separate lines.
  5. Variables can hold text in quotes or numbers without quotes.

Your mission

  1. Python can add, subtract, multiply, and divide numbers.
  2. Set a = 10 and b = 3.
  3. Print the sum (a + b) and the product (a * b).
  4. Try changing the numbers and run again.
  5. Math works inside print() like print(5 + 2).

Your mission

  1. Use if to make decisions in your code.
  2. Set score = 85.
  3. If score is 70 or more, print "Pass".
  4. Otherwise print "Keep practicing".
  5. Indent the lines inside if and else with 4 spaces.

Your mission

  1. A for loop repeats code a set number of times.
  2. Use for i in range(5): to count 0 to 4.
  3. Print each number i on its own line.
  4. Indent the print line inside the loop.
  5. Try range(3) or range(1, 6) and see the difference.

Your mission

  1. A list holds many items: colors = ["red", "blue", "green"].
  2. Print the whole list, then print the first item (index 0).
  3. Use a for loop to print each color on its own line.
  4. Lists use square brackets [ ].
  5. The first item is at position 0, not 1.

Your mission

  1. A function is a reusable block of code.
  2. Define greet() with def and print a message inside.
  3. Call greet() twice at the bottom.
  4. Use def greet(): with a colon and indent the body.
  5. Functions help you avoid repeating the same code.

Your mission

  1. The turtle draws lines as it moves on the canvas.
  2. Import turtle and create t = turtle.Turtle().
  3. Use a for loop to draw a square: forward(80) and left(90).
  4. Repeat 4 times for four sides.
  5. Watch the Turtle panel when you run the code.