Assigning a Variable
Saying what the variable name stands for is called assigning the variable. When you update the value, you are assigning it a new value.
How to Assign a Value to a Variable
Text-based code generally uses a single equal sign (
=
)What follows the = is what is put in the variable
Examples:
Processing and Java-based example:
String name = “Hope”;
float opacity = 0.5; // Equal to 50%
JavaScript example:
var count = 0;
Python example:
count = 0
Last updated
Was this helpful?