Variables
Variables are for storing information through assignment. To create one, simply give your variable a name and set it equal to a value (i.e. a string, number, dictionary, etc.). See and run the below example.
The first statement var1 = 15
creates a variable called var1
and assigns it the value of 15
, an integer. Then on line 3, var1
is displayed through a print
statement.
The second statement var2 = 'This is a variable.'
creates a variable called var2
and assigns it the value of 'This is a variable.'
, a string. Then on line 4, var2
is displayed through a print
statement.
Variables are essentially the buildings blocks of computer programming in any languange. They can be use to help with computations or store information for a database
Now, try creating your own variables and then print them in the below code block.