28   Admin

Data types are the classification or categorization of data items.Data types represent a kind of value which determines what operations can be performed on that data. Numeric, non-numeric and Boolean (true/false) data are the most used data types.

Python has the following standard or built-in data types:

Text Type:str
Numeric Types:intfloatcomplex
Sequence Types:listtuplerange
Mapping Type:dict
Set Types:setfrozenset
Boolean Type:bool
Binary Types:bytesbytearraymemoryview

In Python, the data type is set when you assign a value to a variable:

ExampleData Type 
x = “Welcome”str 
x = 14int 
x = 21.5float 
x = 4jcomplex 
x = [“monkey”, “dog”, “cow”]list 
x = (“orange”, “mango”, “apple”)tuple 
x = range(8)range 
x = {“name” : “Mohan”, “age” : 27}dict 
x = {“mango”, “apple”, “banana”}set 
x = frozenset({“sparrow”, “parrot”, “hen”}) frozenset 
x = Truebool 
x = b”Welcome”bytes 
x = bytearray(6)bytearray 
x = memoryview(bytes(6))memoryview