What does assignment mean?
Giving a variable a value with =, as in x = 10. The right-hand side is worked out first, then stored under the name on the left.
In a lesson
speed = 60stores the number 60 under the namespeed. This is called assignment. From then on, writingspeedmeans 60. The=is not "equals" as in maths; it means "put this value into this name". Read it right to left: take 60, store it inspeed.
Learn it
- Taught in F1.6 Variables, constants and assignment Programming basics, GCSE
Used in
- F1.7 Input from the user
- F4.2 Parameters and return values
- F4.3 Local and global variables
- F5.3 Pseudocode and the exam reference language
- F13.3 Pseudocode in the exam
- F13.7 Where marks are lost
- A1.1 Data types and programming constructs
- A1.4 Subroutines, parameters and passing by reference
- A1.5 Scope, lifetime and debugging in an IDE
- A2.1 Stack frames and the call stack
and 11 more lessons.
Do the lesson in the simulator