This article deals with the basic data types of Python. Every value in Python has a datatype. Since everything is an object in Python programming, data types are actually classes and variables are instance (object) of these classes. In soccer there are different types of players as well. Furthermore, the skillsets of the players differ so that the coach uses them when he needs them. You do the same in Python, you need the right data type to be able to code the way you want it.
Some of the important types are listed below:
- int (integer, whole numbers)
- float (floating point numbers, decimal numbers)
- str (strings)
- bool (truth values)
How to use them in Python? We will deal with int, floats, lists, tuples & strings