Python Built-in Data Types

kisi bhi programming language me Data Types ka most important role hota hai. Isi tarah Python ke case me bhi kai tarah ke built-in data types hain, jinki categories kuch iss tarah hai :

Numeric Types: int, float, complex
Text Type:
str
Sequence Types: list, tuple, range
Mapping Type: dict
Set Types: set, frozenset
Binary Types:
bytes, bytearray, memoryview
Boolean Type: bool

Kisi bhi variable ka Data Type pata karne ke liye hum type() function ka use karte hain, jaisa ki niche diya gaya example show kar raha hai.

x = 5
print(type(x))

O/P : <class ‘int’>

Kisi bhi variable ka Data Type pata karne ke liye hum type() function ka use karte hain, jaisa ki niche diya gaya example show kar raha hai.

Data Type aur unke Syntax: [ Example ]

Str : a = “GTechnicals”
Int : 
a = 67
Float : 
a = 26.7
Complex : 
a = 4j  
List : 
a = [“Cricket”, “Football”, “Basketball”]
Tuple : 
a = (“Cricket”, “Football”, “Basketball”)
Dict : 
a = {“name” : “Rock”, “height” : 6}
Set : 
a = {“Cricket”, “Football”, “Basketball”}  
Frozenset : 
a = frozenset({“Cricket”, “Football”})
Range : a = range(5)
Bool : a = False
Byte : a = b”Python”