Variables

Variables are an essential thing in all programming languages. They help us reuse multiple values more than just once.

One special thing about Python is the implicit type-inference. This means, that we do not have to assign a type to a variable by it's declaration as in Java or C. That means that the compiler does the typing by itself.

Types in Python
In Python we can assing variables of many different types:


 * Integers
 * Floats
 * Strings
 * Chars
 * Complex numbers

This ones are called primitive data types. More complicated types are dictionaries, ...

To view them, follow this link.

Usage of variables
To assign a variable, we use this general Syntax:

variable_name = value

Now see some examples:

Reuse of variables
The main thing about variables is that we can use them more than just one time by calling them. This is done as in the following example: