List
- List एक ऐसा Data Structure है जिसमें एक से अधिक डेटा (Items) को क्रम (Order) में रखा जाता है।
- List data types में एक से ज्यादा items होते हैं |
- List में हर items को comma ( , ) से separate किया जाता है और list के सभी items को square brackets के अंदर close किया जाता है |
- List एक compound data types है जिसमें किसी भी data types के items लिए जा सकते हैं list यह एक mutable data types है इन data types के items की value change की जा सकती है |
- List का पहला Index हमेशा 0 से शुरू होता है।
Syntax :
list_name = [item1, item2, item3]
Source Code :
list = [1, "Hello", 5.6, (1, "Hii")]
for i in list:
print(i)
Tuple
- Tuple भी list के जैसा ही काम करता है लेकिन इसमें data को change नहीं कर सकते हैं | इसलिए इसे Immutable कहते हैं |
- Tuple में हर एक items को comma ( , ) से separate किया जाता है और tuple के सभी items को parenthesis (()) के अंदर close किया जाता है |
- Tuple ये एक compound data type है |
Syntax :
colors = ("Red","Green","Blue")
Source Code :
tuple = (1, "Hello", 5.6, (1, "Hii"))
for i in tuple:
print(i)
tuple[0] = 3 #trying to changing 0th index
print(tuple[0])
Dictionary
- Dictionary data types में keys ओर values की pairs होती है |
- Tuple में key value के pairs को comma ( ,) से और key और value को colon (:) से separate किया जाता है |
- Dictionary के सभी keys और values को curly braces({}) में लिखा जाता है |
- यह एक immutable data type है |
Syntax :
student = {
"Name":"Rahul",
"Age":22,
"City":"Bhopal"
}
Source Code :
dict = {1:"H", 5:"e", 7:"l", 8:"l", 9:"o"}
print(dict[5])
print(dict[9])
Set
- Set Data Type ये items का unordered collection होता है |
- set में दिए हुआ हर एक item नया होता है अगर duplicate item मिल जाता है तो उसे remove किया जाता है |
- set data type के items को curly braces({}) के अंदर लिखा जाता है |
Source Code :
set1 = {"Ramesh", "Suresh", "Kamlesh"}
for i in set1:
print(i)
set2 = {3, 5, 8, 7, 1, 3}
for j in set2:
print(j)
Python indenting
- python में code indentation को काफी महत्व दिया गया है |
- Python में code indentation का use function, classes, loops और control statement के लिए किया जाता है |
- Python में curly brackets ({}) की जगह code indentation का use किया जाता है |
- python में जब code indentation में colon (:) या delimiter दिया जाता है तब automatically अगले line पर interpreter द्वारा tab() दिया जाता है |
For ‘Function’
Source code :
def func():
a = 5
print(a)
func()
For ‘Loop’
Source Code :
list = [1, 5, 8, 9]
for i in list:
print(i)
- Python Full Course Roadmap 2026Python Introduction↓Python Installation & Setup↓Python Basics↓Variables & Data Types↓Operators↓Conditional Statements↓Loops↓Functions↓Data Structures↓File Handling↓Exception Handling↓Object Oriented Programming (OOP)↓Modules & Libraries↓Advanced Python↓Database Connectivity↓Web Development↓Data Science & AI↓Automation & Projects↓Python Developer
- What is Python in Hindi (Basic to advanced)Introduction and History Introduction for Python Python History Python Features Python Applications Applications Uses 1. Artificial Intelligence (AI) and Machine Learning Python का उपयोग AI models, Machine Learning algorithms, Chatbots, Face Recognition, Voice Assistant और Prediction systems बनाने के लिए किया जाता है। 2. Data Science and Data Analysis Python से बड़े datasets को analyze… Read more: What is Python in Hindi (Basic to advanced)
- Python Keywords in Hindi (easy to understand )Python Keywords में ऐसे special word होते हैं जिनका Python भाषा में पहले से एक Predefined meaning होता है। Python Interpreter इन words को पहचानता है और इनके अनुसार कार्य करता है। Example : No. Keyword हिंदी में अर्थ Uses (उपयोग) Syntax 1 False गलत False keywords का use Boolean False value के लिए किया… Read more: Python Keywords in Hindi (easy to understand )
- Python Variables in Hindi (Easy to understand)what is Variable Assigning Value to variable Source Code : Output : 5 Hello [2, 5, 9] Changing Variable’s Values Source Code : Output : 5Hello[4, 5, 8] Assigning Single Value to Multiple Variables Source Code : Output : HelloHelloHelloHello Assigning Value to Variable according to order Source Code : Output : 1H[1, 2] Variable… Read more: Python Variables in Hindi (Easy to understand)
- Python Data Types in Hindi (easy to understand)Python में Data Type यह बताता है कि किसी variable में किस प्रकार का data store है। Python में data type को manually declare नहीं करना पड़ता, Python interpreter value देखकर data type पहचान लेता है। Example : Number Python में Number Data Types का उपयोग संख्याओं (Numbers) को store और process करने के लिए… Read more: Python Data Types in Hindi (easy to understand)
