Python data types

what are datatypes?

Data types are a classification of values/data items. It tells and defines what type of operations can be performed on that particular data. there are datatypes in every programming language, and they have two different groups/variations Primitive data types: Data types that are pre-defined and supported by the programming language. Non-primitive data types: Data types that are derived from the primitive data types and other none primitive datatypes


Primitive data types in python

STRINGS: A string is a collection of one or more characters put in a single quote, double-quote, or triple quote.

  1. NUMERIC: Numeric data types are basically numbers. Numeric data has three different types. Integers - integers are whole real numbers from 1 and they can also be negative as well, unlike javascript, python does not have a limit for the length or size of integers Floats  - float are basically decimal numbers. It is specified by a decimal point. Complex Numbers - Complex number is represented by complex class. It is specified as (real part) + (imaginary part)j. For example - 2+3j

  2. BOOLEAN: Boolean datatypes have only two possible values, True or False.


Non-Primitive data types in python

LISTS: lists are ordered collections of data, in javascript, they are called arrays. This collection of data could be of primitive or non-primitive type. TUPLES: Tuples like lists are ordered collection of data, only differ from list because they are immutable ie they can't be modified or mutated after it has been created SETS:Sets are unordered collections of data that are iterable, mutable, and consist of unique elements. DICTIONARIES: They are a collection of data consisting key, value pairs, they are mutable and unindexed(in javascript these are called objects), and they are usually used to group related data.