Introduction of Python
Getting Started with Python
Syntax in Python
Comment in Python
Variables in Python
Data Types in Python
Numbers in Python
Castings in Python
Strings in Python
Boolean in Python
Operators in Python
List in Python
Tuples in Python
Sets in Python
Dictionary in Python
if Else Statement in Python
While Loop in Python
For Loop in Python
Functions in Python
Lamba Function in Python
Arrays in Python
Classes and Objects in Python
Inheritance in Python
Iterators in Python
Scope in Python
Modules in Python
Dates in Python
Math in Python
JSON in Python
RegEx in Python
Try and Except in Python
User Input in Python
String Formatting in Python
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”