Difference between revisions of "What is variable?"
Jump to navigation
Jump to search
Line 5: | Line 5: | ||
[[File:Images.jpeg]] | [[File:Images.jpeg]] | ||
+ | |||
+ | for example, if we want to read the values of light sensors from the CPX, | ||
+ | |||
+ | we need to give it a name so we can call out the values in our code when we need it. | ||
+ | |||
+ | in this case, we can call it sensorvalue we can also call it x or y or i. | ||
+ | |||
+ | for example: |
Revision as of 15:36, 3 September 2024
Variables
In programming, a variable is a value that can change, depending on conditions or on information passed to the program.
for example, if we want to read the values of light sensors from the CPX,
we need to give it a name so we can call out the values in our code when we need it.
in this case, we can call it sensorvalue we can also call it x or y or i.
for example: