🟢 Beginner  ·  Lesson 01

Introduction to 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.
← Back to Python Tutorial
🔗

Share this topic with a friend

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

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

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

💻 Live Code Editor

This page's programs are ready here — run them, edit them, and learn. No installation needed.
Powered by OneCompiler. The code loads into the editor automatically — press Run to see the output. If the editor does not open, open it in a new tab.