🟢 Beginner  ·  Lesson 01

Introduction to Python

Python का परिचय

What is Python?

Python is a high-level, general-purpose programming language created by Guido van Rossum in 1991. It is known for clean, English-like syntax that is easy to read and write — which is why it is the recommended first language in CBSE Class 11/12 and most B.Tech courses.

💡 In one line

Python lets you write less code to do more work. A task that needs 10 lines in C or Java often needs just 2-3 lines in Python.

Why Python is So Popular

  • Simple syntax — reads almost like English.
  • Beginner-friendly — no semicolons, no type declarations.
  • Huge libraries — NumPy, Pandas, Django, TensorFlow ready to use.
  • Cross-platform — same code runs on Windows, Linux, Mac.
  • In demand — used in AI, data science, web and automation jobs.

Where Python is Used

FieldExample
Data Science & AIPandas, scikit-learn, TensorFlow
Web DevelopmentDjango, Flask
Automation / ScriptingFile handling, web scraping
Apps & GamesTkinter, PyGame

Program 1: Your First Line

Python – first.py
print("Hello, I am learning Python!")
Hello, I am learning Python!
  • print() is a built-in function that shows text on screen.
  • The text inside quotes is a string.
  • No semicolon needed at the end — Python uses the line break.

Program 2: A Tiny Calculator

Python – add.py
a = 10
b = 5
print("Sum     :", a + b)
print("Diff    :", a - b)
print("Product :", a * b)
print("Divide  :", a / b)
Sum : 15 Diff : 5 Product : 50 Divide : 2.0
  • Variables a and b hold numbers.
  • + - * / are arithmetic operators.
  • Notice / gives 2.0 (a float) — Python division always returns a decimal.

Key Features

  • Interpreted — runs line by line, no separate compile step.
  • Dynamically typed — no need to declare variable types.
  • Object-oriented — supports classes and objects.
  • Free & open-source.

Short History

Python was created by Guido van Rossum and released in 1991. The name comes from the comedy group "Monty Python", not the snake. Python 3 (released 2008) is the modern version used today.

Common Mistakes

  • Installing/using old Python 2 instead of Python 3.
  • Forgetting quotes around text in print().
  • Mixing tabs and spaces for indentation.

Practice Tasks

  1. Print your name and class on two separate lines.
  2. Store two numbers and print all four arithmetic results.
  3. Print a small paragraph about why you want to learn Python.

Summary

  • Python is a simple, high-level, interpreted language.
  • Used in AI, data science, web and automation.
  • print() displays output; no semicolons needed.
  • Always use Python 3.

Python क्या है?

Python एक high-level, general-purpose programming language है जिसे Guido van Rossum ने 1991 में बनाया। यह अपनी साफ, English जैसी syntax के लिए जानी जाती है जो पढ़ने-लिखने में आसान है — इसीलिए CBSE Class 11/12 और ज़्यादातर B.Tech courses में इसे पहली language के रूप में सुझाया जाता है।

💡 एक line में

Python में कम code लिखकर ज़्यादा काम होता है। जो काम C या Java में 10 lines लेता है, वह Python में अक्सर 2-3 lines में हो जाता है।

Python इतनी Popular क्यों है

  • Simple syntax — लगभग English जैसी पढ़ी जाती है।
  • Beginner-friendly — न semicolons, न type declarations।
  • बड़ी libraries — NumPy, Pandas, Django, TensorFlow तैयार।
  • Cross-platform — एक ही code Windows, Linux, Mac पर चलता है।
  • Demand में — AI, data science, web और automation jobs में।

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

FieldExample
Data Science & AIPandas, scikit-learn, TensorFlow
Web DevelopmentDjango, Flask
Automation / ScriptingFile handling, web scraping
Apps & GamesTkinter, PyGame

Program 1: आपकी पहली Line

Python – first.py
print("Hello, I am learning Python!")
Hello, I am learning Python!
  • print() एक built-in function है जो screen पर text दिखाता है।
  • Quotes के अंदर का text एक string है।
  • अंत में semicolon की ज़रूरत नहीं — Python line break use करता है।

Program 2: छोटा Calculator

Python – add.py
a = 10
b = 5
print("Sum     :", a + b)
print("Diff    :", a - b)
print("Product :", a * b)
print("Divide  :", a / b)
Sum : 15 Diff : 5 Product : 50 Divide : 2.0
  • Variables a और b numbers रखते हैं।
  • + - * / arithmetic operators हैं।
  • ध्यान दें / 2.0 (float) देता है — Python division हमेशा decimal लौटाता है।

मुख्य Features

  • Interpreted — line by line चलती है, अलग compile step नहीं।
  • Dynamically typed — variable types declare करने की ज़रूरत नहीं।
  • Object-oriented — classes और objects support करती है।
  • Free व open-source

छोटा इतिहास

Python को Guido van Rossum ने बनाया और 1991 में release किया। नाम comedy group "Monty Python" से आया, साँप से नहीं। Python 3 (2008) आज use होने वाला modern version है।

सामान्य गलतियाँ

  • Python 3 की जगह पुराना Python 2 use करना।
  • print() में text के around quotes भूलना।
  • Indentation में tabs और spaces मिलाना।

Practice Tasks

  1. अपना नाम और class दो अलग lines में print करें।
  2. दो numbers store करके चारों arithmetic results print करें।
  3. आप Python क्यों सीखना चाहते हैं, उस पर छोटा paragraph print करें।

सारांश

  • Python एक simple, high-level, interpreted language है।
  • AI, data science, web और automation में use होती है।
  • print() output दिखाता है; semicolons की ज़रूरत नहीं।
  • हमेशा Python 3 use करें।
← Back to Python Tutorial
🔗

Share this topic with a friend

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

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

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

WhatsApp