Number Data types in Python can be broadly divided into Integers and Floats or Floating point values. An integer has no decimal in it, whereas a floating point number can display digits past the decimal point.
These are very basic data types in Python. An important point to note is that Python 3 performs true division by default, so 1/2 will be printed as 0.5 and not 0. (No rounding up takes place, as explained in the previous tutorials).
Boolean Data type conveys whether a given statement is True or False. It is used a lot in programming, and plays a key role.
We can assign a boolean value to a variable as follows-
var_=True print(var_) var_=False print(var_)
And we will get the following output-
Boolean values are mostly used as flags – Flags basically act as a signal for a function or a process, like when to get out of a loop or when to assign a particular variable a particular value (when you practice later on, you will understand what I am trying to say), etc.
They are also used a lot as conditions in conditional statements ( we will see what these are later on, just remember this fact).
I have made these two tutorials on basics of lists –
After this, we will move onto strings, which are just lists of characters.