Python is one of most used programming language in data science. It is a general purpose language and helps to generate insights quickly. Python community has developed a whole lot of very useful data science libraries such as NumPy, Pandas, Scikit Learn etc.
One of main reasons of its popularity among data scientists is its simple syntax and data types. Python has got following built-in data types;
- Floating-point numbers
- Complex numbers
- Boolean type, and
- Boolean context.
In this article we will quickly look into how the objects of these types look like, and how to represent them.
In Python 3, there is no limit that how long an integer value can be in. It depends on the amount of memory your system has. If enough memory is there, an integer can be as long as you need it to be.
In Python, float values are specified with a decimal point and the float type designates a floating-point number. Alternatively scientific e or E can be added to specify scientific notation after positive or negative integer.
Such numbers which are specified as
The sequences of character data are known as Strings. Using single or double quotation marks literals strings can be separated. All characters are part of the string between the opening separator and the associated closing separator
It must be mentioned that Python can contain as many characters as you want in a string. Your machine's memory processing is the only restriction. A string can also be empty.
The objects of Boolean type may have one of two possible values, True or False:
Boolean context is often used to evaluate expressions in Python, meaning they are interpreted to represent truth or falsehood. Sometimes “truthy” is used for a value that is true in Boolean context and one that is false in Boolean context is said to be “falsy.”
Such boolean objects that are equal to True are “truthy”, and those which are equal to False are falsy are evident by the “truthiness.”