Python Beginner-Level Topics (Hindi Notes)
1. Python Kya Hai?
Python ek simple aur beginner-friendly programming language hai. Iska use software development,
web development, data science, aur AI/ML projects ke liye hota hai.
2. Python Installation Aur Setup
Aap Python ko python.org se download kar sakte hain. Install karne ke baad terminal ya IDE (jaise
VS Code ya PyCharm) ka use karke code likh sakte hain.
3. Python Mein Pehla Program
Sabse simple program 'Hello, World!' hota hai.
Code:
print("Hello, World!")
Output: Hello, World!
4. Variables Aur Data Types
Variables ka use data store karne ke liye hota hai. Example:
name = "Rahul" # String
age = 25 # Integer
pi = 3.14 # Float
is_student = True # Boolean
5. Input Aur Output
Input lene aur output dene ke liye:
Code:
name = input("Aapka naam kya hai? ")
print("Namaste,", name)
6. Operators
Python mein alag-alag operators hote hain:
- Arithmetic: +, -, *, /, %, //, **
- Comparison: ==, !=, >, <, >=, <=
- Logical: and, or, not
7. Conditional Statements
If-else ka use decision making ke liye hota hai:
Code:
age = 18
if age >= 18:
print("Aap vote de sakte hain.")
else:
print("Aap vote nahi de sakte.")
8. Loops (for aur while)
Loops ka use repetitive tasks ke liye hota hai:
For Loop:
for i in range(5):
print(i)
While Loop:
count = 0
while count < 5:
print(count)
count += 1