🐍
Basics

Python Kya Hai?

Introduction
💡 Python ek automatic transmission car jaisa hai — C/C++ manual transmission hain (tumhe har gear khud control karna padta hai, memory management, types), Python automatic hai (bahut kuch khud handle ho jaata hai), isliye chalana bahut aasan hai, ekdum beginner ke liye bhi.

Python 1991 mein Guido van Rossum ne banayi thi — design philosophy hai "readable, simple code". Aaj Python data science, AI/ML, web development (Django, Flask), automation scripts, aur bahut kuch mein use hoti hai — sabse popular languages mein se ek hai duniya mein.

Python "interpreted" language hai — C/C++/Java ki tarah pehle compile nahi hoti, line-by-line seedha chalti hai ek interpreter ke through. Isse development fast hoti hai (turant test kar sakte ho), lekin usually raw execution speed compiled languages se kam hoti hai.

Python "dynamically typed" hai — variable ka type declare karne ki zaroorat nahi (C/Java ke ulat), aur ek hi variable different types ki values hold kar sakta hai apni lifetime mein. Ye flexibility deta hai, lekin runtime par type errors bhi aa sakte hain jo compile-time languages catch kar lete.

# Python mein "Hello World" bas ek line hai:
print("Hello, Python!")

# Koi semicolons zaroori nahi, koi curly braces nahi —
# indentation (spacing) hi code blocks define karti hai
🐍
Python ek automatic transmission car jaisa hai — C/C++ manual transmission hain (tumhe har gear khud control karna padta hai, memory management, types), Python automatic hai (bahut kuch khud handle ho jaata hai), isliye chalana bahut aasan hai, ekdum beginner ke liye bhi.
1 / 6
⚡ Quick Recap
  • Interpreted, dynamically-typed, aur bahut readable
  • Data science, AI/ML, web dev, automation — sab jagah use hoti hai
  • 1991 mein Guido van Rossum ne banayi
Is page mein (2 subtopics)

Python 2 aur 3 mein kaafi farq tha (print statement vs print() function, string handling waghera) — Python 2 ka official support 2020 mein khatam ho gaya. Aaj sirf Python 3 use karo, koi bhi naya project Python 2 mein shuru nahi karna chahiye.

# Python 2 (purana, mat use karo):
# print "Hello"

# Python 3 (current standard):
print("Hello")
💡Tip: Agar kisi purane tutorial/codebase mein print "text" (bina parentheses) dikhe, samajh jao wo Python 2 hai — outdated hai.

Terminal mein python ya python3 type karke ek "REPL" (Read-Eval-Print Loop) khul jaata hai — line-by-line Python code turant test kar sakte ho, bina file banaye. Learning aur quick experiments ke liye bahut useful.

$ python3
>>> x = 5
>>> x + 10
15
>>> print("Hello")
Hello
💡Tip: Jupyter Notebooks ek aur popular way hai interactively Python chalane ka — especially data science mein, jaha code + output + notes ek saath rakhna useful hota hai.