03/05/2026
π L4.2 β Constants
What if a value should NEVER change? π
π· Constant = a value that cannot be changed during program ex*****on
π» Used when a value must stay fixed
---
π What you MUST know:
β’ Value is set once and never changes
β’ Makes code more reliable
β’ Often written in CAPITALS
β’ Improves readability
---
π§ Example:
SET PI = 3.14
SET radius = 5
SET area = PI * radius * radius
β‘οΈ PI stays the same throughout
---
π― EXAM TIP:
Use constants for fixed values
β Changing them = logic errors
---
β οΈ COMMON MISCONCEPTION:
β Constants can be updated later
β
WRONG β they stay fixed
---
π§ Quick challenge:
Which is a CONSTANT?
A) score
B) MAX_SIZE
π Comment your answer
---
π Follow for daily GCSE Computer Science breakdowns
βοΈ sir mucho tutorials