Free tutorials & notes in Hindi & English · Clean code examples · Mobile friendly learning
🟢 Beginner  ·  Lesson 01

Python का परिचय

Written and reviewed by · Senior IT Faculty · 15+ years’ experience

Python क्या है?

Python एक high-level, general-purpose programming language है। “High-level” का अर्थ है कि learner processor instructions को सीधे control करने के स्थान पर print(), lists और functions जैसी readable instructions के साथ काम करता है। “General-purpose” का अर्थ है कि language केवल एक field तक सीमित नहीं है—इसी core language से school program, automation script, website, data-analysis notebook या machine-learning project बनाया जा सकता है।

एक line में definition

Python readable programming language है जो beginners को problem-solving सीखने और professionals को libraries के बड़े ecosystem के साथ practical software बनाने में मदद करती है।

Python code case-sensitive है: name, Name और NAME तीन अलग identifiers हैं। Source file सामान्यतः .py extension प्रयोग करती है। नए learners को modern Python 3 use करनी चाहिए।

Python क्यों सीखें?

  • Readable syntax: code अपेक्षाकृत छोटा और ordinary mathematical या English notation के निकट होता है।
  • Fast feedback: beginner छोटा program तुरंत run करके result देख सकता है।
  • Strong fundamentals: variables, decisions, loops, functions, collections, files, exceptions और OOP सीखते हैं।
  • Large standard library: text, files, dates, mathematics, JSON, databases और testing के modules साथ मिलते हैं।
  • Wide ecosystem: third-party packages web, automation, data science, ML और scientific computing support करते हैं।
  • Transferable thinking: Python में सीखे algorithms बाद में C, C++, Java या JavaScript में भी काम आते हैं।
Faculty advice

केवल syntax याद न करें। Output predict करें, variable values trace करें, हर example बदलें और समझाएँ कि नया output क्यों आया।

Python Program कैसे चलता है?

Python को अक्सर interpreted language कहा जाता है, लेकिन यह short label पूरी प्रक्रिया नहीं बताता। सबसे अधिक उपयोग होने वाले implementation CPython में सामान्य flow है:

  1. आप .py file में source code लिखते हैं।
  2. CPython syntax check करके source को प्रायः bytecode नाम के intermediate form में compile करता है।
  3. Python virtual machine उस bytecode को execute करती है।
  4. Imported modules का cached bytecode __pycache__ folder में हो सकता है।

यह प्रक्रिया automatic है; beginner सामान्यतः source file सीधे run करता है। PyPy जैसे दूसरे implementations अलग execution techniques प्रयोग कर सकते हैं।

Python Install और Run करें

  1. python.org/downloads या approved package manager से supported Python 3 install करें।
  2. Windows installer में option मिले तो Add Python to PATH चुनें।
  3. Command Prompt, PowerShell या Terminal में version check करें।
Terminal
python --version
# Linux/macOS पर अक्सर
python3 --version
# Windows Python Launcher
py --version

जो command Python 3 version दिखाए उसे use करें। Illustrated steps के लिए Python Setup: Windows, VS Code and IDLE पढ़ें।

Interactive shell और script

MethodBest useExample
Interactive shellएक expression तुरंत test करना>>> 7 * 8
Script fileComplete program save और re-run करनाpython first.py

Program 1: पहला Output

Python – first.py
print("Hello, I am learning Python!")
print("CodingEasily makes concepts clear.")
Hello, I am learning Python! CodingEasily makes concepts clear.
  • print() built-in function values को standard output पर भेजता है।
  • Quotes के अंदर text एक string है।
  • हर print() call default रूप से newline पर समाप्त होती है।
  • Python statement के अंत में सामान्यतः semicolon नहीं लिखा जाता।

Program 2: Input, Conversion और Calculation

Python – marks.py
name = input("Student name: ")
marks = float(input("Marks out of 100: "))
percentage = marks

print("Student:", name)
print("Percentage:", percentage, "%")
Student name: Ananya Marks out of 100: 87.5 Student: Ananya Percentage: 87.5 %

input() text लौटाता है। float(...) marks को number में convert करता है। Invalid numeric input पर ValueError आता है; exception handling आगे पढ़ेंगे।

Essential Syntax और Indentation

Python – decision.py
score = 72

if score >= 40:
    print("Pass")
    print("Well done")
else:
    print("Needs improvement")
Pass Well done
  • Colon if या else का block आरंभ करता है।
  • Indentation Python syntax का भाग है और block define करती है।
  • हर indentation level के लिए चार spaces standard style है।
  • Tabs और spaces मिलाने से error या misleading alignment हो सकती है।
  • Hash sign normal single-line comment शुरू करता है: # explanation

Detailed lesson: Python Syntax, Indentation and Comments.

मुख्य Data Types का Preview

TypeExampleMeaning
intage = 16Whole number
floatprice = 49.5Floating-point number
strcity = "Khurja"Unicode text
boolis_present = TrueTrue या False
listmarks = [78, 85, 91]Ordered, mutable collection
tuplepoint = (4, 7)Ordered, immutable sequence
dict{"name": "Aarav"}Key-value mapping

Python dynamically typed है: variable name एक declared type से permanently restricted नहीं है। फिर भी हर value का type होता है। आगे Variables and Data Types पढ़ें।

Python कहाँ Use होती है?

AreaTypical workExamples
AutomationFiles rename, reports, CSV/JSON processingStandard library, openpyxl
Web developmentServer applications और APIsDjango, Flask, FastAPI
Data analysisData clean, transform और visualiseNumPy, pandas, Matplotlib
AI और MLModels train, evaluate और usescikit-learn, PyTorch, TensorFlow
Scientific computingSimulation, statistics और researchSciPy, Jupyter
EducationAlgorithms, projects, CTIDLE, notebooks

Library एक tool है, language नहीं। पहले core Python सीखें; फिर problem के अनुसार library चुनें।

Python की Important Features

  • Readable: indentation blocks को visually organise करती है।
  • Multi-paradigm: procedural, OOP और functional styles support करती है।
  • Automatic memory management: routine allocation runtime handle करता है।
  • Cross-platform: portable code major OS पर चल सकता है, पर dependencies को test करना पड़ता है।
  • Extensible: C/C++ libraries और external systems से interact कर सकती है।
  • Open source: CPython और standard library openly develop होते हैं।

Strengths और Limitations

StrengthPractical limitation
Concise developmentTests/type checking न हो तो dynamic type errors runtime पर आ सकते हैं।
Rich packagesPackages carefully select, update और secure करने होते हैं।
Excellent scripting/data toolsकुछ CPU-intensive work में pure Python compiled native code से धीमी हो सकती है।
Many platformsDesktop packaging, mobile deployment और OS-specific behaviour में extra tools लग सकते हैं।

Language choice engineering decision है। Readability, development speed और libraries महत्वपूर्ण हों तो Python उत्कृष्ट है; real-time control, tiny embedded systems या maximum native performance के लिए lower-level language बेहतर हो सकती है।

संक्षिप्त और सही इतिहास

  • Guido van Rossum ने ABC language से प्रभावित होकर Python पर काम शुरू किया।
  • पहला public Python release 1991 में आया।
  • नाम comedy group Monty Python से inspired था, snake से नहीं।
  • Python 3.0 2008 में release हुई और कुछ पुराने design decisions सुधारे गए।
  • Python 2 का end of life 2020 में हुआ; नया development Python 3 पर करें।

Recommended Learning Roadmap

  1. Python, IDLE और VS Code setup
  2. Syntax, indentation और comments
  3. Variables और data types
  4. Input/output और operators
  5. Conditions और loops
  6. Functions, collections, files और exceptions
  7. Goal के अनुसार OOP, testing, projects, data science और AI

अभ्यास और Self-Check

  1. अपना नाम, class और city अलग lines में print करें।
  2. Length और breadth लेकर rectangle का area display करें।
  3. Five subjects के marks लेकर total और average display करें।
  4. print(type(5 / 2)) का output predict करके run करें और कारण समझाएँ।
  5. Pass/fail program को boundary values 39, 40 और 41 से test करें।
अपनी समझ जाँचें

Q1. input() क्या लौटाता है? उत्तर: string। Q2. Normal comment कौन-सा symbol शुरू करता है? उत्तर: #Q3. Indentation क्यों महत्वपूर्ण है? उत्तर: यह code block define करती है और syntax का भाग है।

Authoritative संदर्भ

इन references को 14 August 2026 को review किया गया। Explanation और examples CodingEasily learners के लिए original रूप से लिखे गए हैं।

सारांश

  • Python readable, high-level और general-purpose language है।
  • CPython सामान्यतः source को bytecode में compile करके virtual machine में execute करता है।
  • Indentation blocks define करती है और Python dynamically typed है।
  • Python education, automation, web, data science, scientific work और AI support करती है।
  • Python 3 use करें, programs बदलकर practise करें और roadmap क्रम से पूरा करें।

अक्सर पूछे जाने वाले प्रश्न (FAQ)

सरल शब्दों में Python क्या है?
Python एक high-level, general-purpose programming language है जिसका code पढ़ना आसान बनाया गया है। इसका उपयोग programming सीखने, automation, web applications, data analysis, scientific work और artificial intelligence में होता है।
Python compiled है या interpreted?
Python को सामान्यतः interpreted कहा जाता है, लेकिन पूरा उत्तर implementation पर निर्भर करता है। CPython प्रायः source code को bytecode में compile करता है और Python virtual machine उस bytecode को execute करती है।
Python beginners के लिए उपयुक्त क्यों है?
Python की syntax concise है, indentation अर्थपूर्ण है और standard library बड़ी है। विद्यार्थी variables, conditions, loops, functions तथा objects जैसे concepts सीखते हुए जल्दी उपयोगी programs बना सकते हैं।
क्या Python में semicolon और type declaration आवश्यक हैं?
Python statement के अंत में सामान्यतः semicolon आवश्यक नहीं है और assignment से पहले variable का fixed type declare नहीं करना पड़ता। Python dynamically typed है, लेकिन प्रत्येक value का निश्चित type होता है।
Beginner को कौन-सा Python version install करना चाहिए?
python.org या approved package manager से supported Python 3 release install करें। Python 2 obsolete है। Operating system के अनुसार python --version, python3 --version या py --version से installation जाँचें।
Python Introduction के बाद क्या पढ़ें?
यह क्रम अपनाएँ: setup, syntax और comments, variables और data types, input/output, operators, conditions, loops, functions, collections, files, exceptions और object-oriented programming।
← Back to Python Tutorial
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।

💻 लाइव कोड एडिटर

इस पेज के प्रोग्राम यहीं तैयार हैं — चलाएँ, बदलें और सीखें। कुछ भी इंस्टॉल किए बिना।
OneCompiler द्वारा संचालित। कोड एडिटर में अपने आप आ जाता है — Run दबाकर आउटपुट देखें। अगर एडिटर न खुले तो नए टैब में खोलें.