eric_barnett
eric_barnett 7d ago β€’ 0 views

Scratch If Then statement examples for beginners

Hey there! πŸ‘‹ Learning about 'if-then' statements in Scratch? Awesome! They're super important for making your games and animations interactive. This guide breaks down the basics, and the quiz will help you check your understanding. Let's get started! ✨
πŸ’» Computer Science & Technology

1 Answers

βœ… Best Answer
User Avatar
deannamiller1996 Dec 29, 2025

πŸ“š Quick Study Guide

  • πŸ±β€πŸ’» What is an 'If-Then' statement? An 'If-Then' statement in Scratch (and programming in general) is a conditional statement. It checks if a certain condition is true, and if it is, then it executes a specific block of code.
  • 🚦 Syntax: In Scratch, the 'If-Then' block is found in the 'Control' category. It essentially reads as: IF (condition) THEN (do something).
  • ✨ Common Conditions: Conditions can involve comparing numbers (e.g., score > 10), checking if a sprite is touching another sprite (e.g., touching 'mouse-pointer'?), or checking if a variable has a specific value (e.g., lives = 0).
  • 🧩 Example: If the score is greater than 50, then say 'You Win!'.
  • 🎭 'If-Then-Else' Block: Scratch also provides an 'If-Then-Else' block. This allows you to execute one block of code if the condition is true and a *different* block of code if the condition is false.
  • πŸ’‘ Nested 'If-Then' Statements: You can put 'If-Then' statements inside other 'If-Then' statements to create more complex logic.

Practice Quiz

  1. What category in Scratch contains the 'If-Then' block?
    1. A. Motion
    2. B. Looks
    3. C. Control
    4. D. Sensing
  2. What does an 'If-Then' statement do?
    1. A. Repeats a block of code forever.
    2. B. Executes a block of code only if a condition is true.
    3. C. Changes the color of a sprite.
    4. D. Moves a sprite randomly.
  3. Which of the following is a valid condition for an 'If-Then' statement?
    1. A. touching color red?
    2. B. score + 5
    3. C. move 10 steps
    4. D. say hello
  4. What happens if the condition in an 'If-Then' statement is false?
    1. A. The code inside the 'Then' block is executed.
    2. B. The program stops.
    3. C. Nothing happens.
    4. D. The sprite disappears.
  5. What is the purpose of the 'If-Then-Else' block?
    1. A. To repeat a block of code a specific number of times.
    2. B. To execute one block of code if a condition is true and another if it's false.
    3. C. To change the volume of the sound.
    4. D. To create a new sprite.
  6. Which of the following is an example of a nested 'If-Then' statement?
    1. A. An 'If-Then' statement inside another 'If-Then' statement.
    2. B. Two 'If-Then' statements side by side.
    3. C. An 'If-Then' statement with no condition.
    4. D. An 'If-Then' statement with no code inside the 'Then' block.
  7. If the variable 'lives' is equal to 0, and you use the condition 'lives > 0' in an 'If-Then' statement, will the code inside the 'Then' block be executed?
    1. A. Yes
    2. B. No
    3. C. Maybe
    4. D. It depends on the sprite's color.
Click to see Answers
  1. C
  2. B
  3. A
  4. C
  5. B
  6. A
  7. B

Join the discussion

Please log in to post your answer.

Log In

Earn 2 Points for answering. If your answer is selected as the best, you'll get +20 Points! πŸš€