03 Variables 4a7ed66b804d
03 Variables 4a7ed66b804d
And when we
Subject: Variables want them we recalled these numbers and used them.
Overview
Commands to be Used
Variables are boxes which save the data we enter for us. By declaring a
variable we form a box for ourselves, then when we need it, we can recall the data The variables they will use in order to complete the tasks and their usage forms.
from the box and use it. We can use the data in the boxes we formed when we
need it by recalling them again and again. Blocks and Button icons to be used in the training about this subject
In order to perform an action the first thing to be done is to store that data.
When we want to perform an action we recall the data from the storage and Block Explanation
perform the required actions. In the programming languages, we use the variables The name of the variables may be letters such as a,b,c
in order to express the data in the storage. To sum up; they are the declarations or words in a similar way. The important thing is to
that we make for storing the data processed in the programming language inside use the name which we use to indicate the variable in
the storage of the computer. the beginning in the same way when we recall it.
Activity
Sample usage (Python):
Suppose that we have two numbers and we add these two numbers and Button a=5
say the result. The action that we must perform will be formed from the steps forward(a)
similar to the ones below.
Sample usage (Javascript):
say a number (3) var a = 5
say another number (5) forward(a)
add these two numbers (3+5)
say the result (8)
BLOCK
3+5=8
When a number is said, we stored that number to a part of our memory. Usage Explanation
And when the second number is said we also recorded it to another part of our
Variable name
memory. In the next stage we added the two numbers using the addition method
that we had learnt before.
At the end we recorded these values that we added to another part of our
memory. Then we said this result we stored aloud.
Consider that the numbers that will be added for this action change
continuously. Now here at this point variable declaration gets involved. As in the Value given to the variable
example above, we declared two different variables and stored the numbers in
codementum.com
PYTHON Usage Variable
Usage Explanation
Variable name
Usage of variable
Usage of Variable
Python
JAVASCRIPT
codementum.com
Sample Solution: Scene 23
codementum.com