🌍 SGCA Year 3 β€” Coding Reference Sheet

Syntax World | Keep this sheet handy while coding!

πŸš€πŸ€–

Student: _______________________

Class: _____________ Year: 3

Β© 2026 InfiniCoreCipher | v3.0

πŸ“¦ Variables
What is a variable?
A named box that stores information. Give it a label, put a value inside!
# Create (STORE) name = "Alex" # Text age = 8 # Number ready = True # Boolean # Change score = 0 score = score + 10 # Print (SHOW) print("Score:", score)
VAR FLOW
VAR β†’ STORE β†’ CHANGE β†’ PRINT
3 Data Types
πŸ“ Text: "Hello" (in quotes)
πŸ”’ Number: 42 (no quotes)
βœ… Boolean: True / False
⚠️ Common Mistakes
player name = "x"player_name = "x"
score = "100"score = 100
print scoreprint(score)
ready = trueready = True
πŸ” Loops
FOR loop β€” set number of times
# Repeat 5 times (0,1,2,3,4) for i in range(5): print("Hello!") # Count 1 to 10 for i in range(1, 11): print(i) # Use the variable for i in range(1, 6): print("Star", i)
WHILE loop β€” while condition is true
# Count down from 5 count = 5 while count > 0: print(count) count = count - 1
FOR vs WHILE β€” when to use?
πŸ”΅ FOR: Know exactly how many times
🟒 WHILE: Don't know how many times
⚠️ Infinite Loop β€” DANGER!
If the condition never becomes False, the loop runs forever! Always make sure something changes inside the loop.
range() quick guide
range(5) β†’ 0,1,2,3,4
range(1,6) β†’ 1,2,3,4,5
range(0,10,2) β†’ 0,2,4,6,8
🏜️ Conditionals
IF-ELSE
if score >= 80: print("You passed! 🌟") else: print("Try again! πŸ’ͺ")
IF-ELIF-ELSE (multiple choices)
if score >= 90: print("Grade: A") elif score >= 80: print("Grade: B") elif score >= 70: print("Grade: C") else: print("Grade: F")
Comparison Operators
> greater than Β  < less than
>= greater or equal Β  <= less or equal
== equal to Β  != not equal to
Boolean Operators
ANDBoth must be True
ORAt least one must be True
NOTFlips True↔False
ABA AND BA OR BNOT A
TTTTF
TFFTF
FTFTT
FFFFT
πŸ™οΈ Functions
Define and Call
# Define (create) def greet(): print("Hello! πŸš€") # Call (use) greet() greet() # Use again!
With Parameters (inputs)
def greet(name): print("Hello,", name) greet("Alex") greet("Nova")
With Return (output)
def add(a, b): result = a + b return result answer = add(5, 3) print(answer) # 8
Function Path
CALL β†’ RUN β†’ RETURN
Define first, then call!
Parts of a Function
🏷️ Name: What you call it (greet)
πŸ“¦ Parameter: Input (name)
πŸ“‹ Body: What it does (indented)
↩️ Return: What it sends back
πŸ“‹ Sequences & Algorithms
Sequence
Steps in a specific order. Order matters β€” changing it changes the result!
Algorithm
A precise, step-by-step plan. Exact enough for a robot to follow without asking questions!
Flowchart Symbols
β¬­ Oval: Start / End
β–­ Rectangle: Action / Step
β—‡ Diamond: Decision (Yes/No)
β†’ Arrow: Flow direction
Bot Commands
MOVE β€” go forward 1 step
TURN_LEFT β€” rotate 90Β° left
TURN_RIGHT β€” rotate 90Β° right
COLLECT β€” pick up item
Sequence vs Algorithm
πŸ“‹ Sequence: "Make a sandwich"
πŸ€– Algorithm: "Get 2 slices of bread. Spread 5g butter on each slice. Add 2 slices of cheese..."
⭐ Ranks & Glossary
XP Ranks
🌱
Cadet
0 XP
πŸ”­
Explorer
500 XP
🧭
Navigator
1,500 XP
⚑
Captain
3,000 XP
πŸ‘‘
Admiral
6,000 XP
Key Terms
Variable: Named data container
Loop: Repeating code
Conditional: IF-THEN decision
Boolean: True or False
Function: Reusable code block
Parameter: Function input
Return: Function output
Debug: Find and fix errors
Algorithm: Step-by-step plan
Sequence: Steps in order
πŸš€ Nova's Golden Rules
1️⃣
Plan before you code
2️⃣
Test after every change
3️⃣
Mistakes are how we learn
4️⃣
Read error messages carefully
5️⃣
Ask for help when stuck