|
|
Variables are used to represent values by name and allow you to access the original value or manipulate the original value.
|
|
|
For example we would store the integer value 10 into a variable named "a" which would then allow us to refer to "10" by
|
|
|
using the name "a".
|
|
|
|
|
|
\begin{lstlisting}
|
|
|
a = 10
|
|
|
print a
|
|
|
\end{lstlisting}
|
|
|
|
|
|
In the above example the output would be "10" because the value 10 is stored in the variable "a" and then we access the original value
|
|
|
10 when we print a.
|
|
|
|
|
|
\subsection{Data Types}
|
|
|
|
|
|
Programming languages support different types of data types or different types of values that they can represent in variables.
|
|
|
Some programming languages use multiple different types of values but most of them support the basic types: string, integer
|
|
|
and boolean (true or false).
|
|
|
|
|
|
\begin{lstlisting}
|
|
|
string = "Brett"
|
|
|
integer = 10
|
|
|
boolean = false
|
|
|
\end{lstlisting}
|
|
|
|
|
|
Please keep in mind that each programming language supports different data types and you should research those types to better
|
|
|
understand variables in that language.
|
|
|
|
|
|
\subsection{Operations}
|
|
|
|
|
|
\subsection{Conclusion}
|