Learn to Code-02 - page from the textbook
Back to Class
2

Learn to Code-02

34-52 • Source: SCERT Delhi ICT Textbook, Revised Edition 2026 3 Fun Facts
8 min read

The field guide

Understand it. Try it. Remember it.

Programs become useful when they respond to different situations. Practice turning a decision into a clear condition, repeating actions with a loop and testing the result in Scratch instead of guessing what the blocks will do.

Textbook reference: pages 34-52

01
Condition
Branch
03
Result
Concept mapFollow the pathLearn to Code-02: Condition, Branch, Result

In this lesson

01

Problem Solving Approach

Definition

Definition: Problem solving means understanding the goal, planning a solution and testing it - often by breaking a big task into smaller steps.

Steps

  1. 1

    Understand: What exactly is the problem?

  2. 2

    Plan: Break the task into steps.

  3. 3

    Test: Run and check; debug errors.

02

Decision Making in Programs

Definition

Definition: Programs often need to make decisions: 'if something is true, do this, otherwise do that'.

  • A condition is a check that is either true or false.
  • if block - runs the inside blocks only when the condition is true.
  • if-else block - one path when true, another when false.
03

Loops

Definition

Definition: Loops repeat actions without writing the same blocks again and again.

  1. 1

    repeat n: Repeats the inside blocks n times.

  2. 2

    repeat until: Repeats until the condition becomes true.

  3. 3

    forever: Repeats until the program is stopped.

04

Building with Scratch 3.0

Definition

Definition: Scratch is a block-based coding tool: the sprite (character) acts on the stage, and puzzle-like blocks snap together to give it instructions.

  • Combine decision blocks and loops to build animated stories and simple games.
  • Debugging means finding and fixing errors in your program.
  • Test your program step by step.

Your turn

Try a quick challenge

Design a program that says whether a number is greater than 5. List tests that cover true, false and equal cases.

Quick Revision

  • Sprite: the character that acts in Scratch.
  • Condition: a true/false check.
  • Loop: repeating actions without rewriting blocks.
  • if-else: choosing between two paths.
  • Debugging: finding and fixing errors.

Conclusion: Understand the problem, plan with decisions and loops, then test and debug - that is how every good program is built.

Keep in mind

Quick recap

  • Break a problem into inputs, decisions, actions and outputs.
  • Conditions choose a branch; loops repeat actions.
  • Test boundary and unexpected cases, not only the easiest input.

Key Terms

Problem Solving

समस्या-समाधान

Decision Making

निर्णय लेना

Loop

क्रियाओं का दोहराव

Condition

शर्त

Scratch 3.0

ब्लॉक-आधारित कोडिंग उपकरण