Assignment
Also known as: variable assignment, assignment operator
The operation of storing a value in a variable. Assignment is the most basic operation in programming.
๐ก Intuition
Assignment is like putting a label on a box and putting something inside. The label is the variable name; the contents is the value.
Core Idea
Assignment is not equality โ it's an action. x = x + 1 makes no sense in math, but in programming it means 'update x.'
๐ฌ Example
๐ฏ Why It Matters
Assignment is the most basic operation in programming. Every variable gets its value through assignment.
โ ๏ธ Common Confusion
= means 'assign,' not 'equals.' Many languages use == for equality comparison.
Related Concepts
How Assignment Connects to Other Ideas
To understand assignment, you should first be comfortable with variable. Once you have a solid grasp of assignment, you can move on to integer, string and boolean.
Go Deeper
Frequently Asked Questions
What is Assignment in CS Thinking?
The operation of storing a value in a variable. The variable name goes on the left, the value on the right.
Why is Assignment important?
Assignment is the most basic operation in programming. Every variable gets its value through assignment.
What do students usually get wrong about Assignment?
= means 'assign,' not 'equals.' Many languages use == for equality comparison.
What should I learn before Assignment?
Before studying Assignment, you should understand: variable.