Python Basics - 2

We will be discussing about Data types.

Data Types

Let's just understand that data can be of different types like numbers, text etc.Thus we have different data types representing the different type of real world data.

We have Primitive data types and Non Primitive Data types,let's Look at each of them for better understanding

Primitive data types

1.Numbers (int , float , complex)

2.Str

3.boolean

Numbers

•int Numbers can be integers like -3,0,3 etc

•float
floats(Decimals) like 3.2,-2.8,0.7 etc.

•complex Complex numbers like 2+3j,-2-2j etc. (We use j instead of i in python)

str

Strings can be anything but generally text, strings are always wrapped with " or ' quotes

Ex: "pew pew" , "professor py" etc.

bool

Boolean data types has only two values it's either True or False.(First Letter should be capital in Python)

Non-Primitive data types

1.Lists 2.tuples 3.dict 4.sets

Simply,Non - primitive data types are collection of primitive data types

Ex: [1,"hello",22.5,True] (list)