Informatics Practices

Introduction to Python | Basics of Python Programming | Complete Notes | CBSE Class 11 Informatics Practices (2026–27)

Class 11 · Informatics Practices

Introduction to Python | Basics of Python Programming

Python is one of the world's most popular programming languages. It is widely used in education, web development, artificial intelligence, data science, automation, cybersecurity, and software development. Python is known for its simple syntax, readability, and ease of learning, making it an ideal programming language for beginners.


What is Python?

Definition

Python is a high-level, interpreted, general-purpose programming language that enables programmers to write simple, readable, and efficient programs.

Python follows an easy-to-understand syntax similar to the English language, allowing beginners to learn programming concepts quickly.


History of Python

Python was developed by Guido van Rossum in the late 1980s at Centrum Wiskunde & Informatica (CWI), Netherlands. The first official version, Python 0.9.0, was released in 1991.

The name "Python" was inspired by the British comedy television series Monty Python's Flying Circus and not by the snake.


Features of Python

Feature Description
Simple Easy to read and write.
Interpreted Programs are executed line by line.
High-Level Focuses on programming rather than hardware details.
Portable Runs on Windows, Linux, and macOS with minimal changes.
Open Source Available free of cost.
Object-Oriented Supports object-oriented programming concepts.
Large Standard Library Provides many built-in modules and functions.

Why Learn Python?

  • Easy for beginners.
  • Simple and readable syntax.
  • Used in many industries.
  • Excellent community support.
  • High demand in the job market.
  • Supports multiple programming paradigms.

Applications of Python

Field Examples
Web Development Django, Flask
Data Science NumPy, Pandas
Artificial Intelligence Machine Learning, Deep Learning
Automation Task Automation, Scripting
Game Development Simple games using Python libraries
Cyber Security Security testing and automation
Education Teaching programming concepts

Installing Python

To start programming in Python, download and install the latest stable version from the official Python website.

  1. Download Python.
  2. Run the installer.
  3. Select Add Python to PATH.
  4. Complete the installation.
  5. Open Python IDLE.

Python IDLE

IDLE

IDLE (Integrated Development and Learning Environment) is the default environment provided with Python. It allows users to write, edit, save, and execute Python programs.

Features of IDLE

  • Interactive Shell
  • Script Editor
  • Syntax Highlighting
  • Automatic Indentation
  • Debugging Support

Execution Modes in Python

Python programs can be executed in two different modes.


1. Interactive Mode

In Interactive Mode, Python executes each statement immediately after it is entered.

Advantages

  • Quick testing.
  • Immediate output.
  • Useful for beginners.

Example

>>> 5 + 3
8

>>> print("Hello")
Hello

2. Script Mode

In Script Mode, Python programs are written in a file with the .py extension and executed together.

Advantages

  • Suitable for larger programs.
  • Programs can be saved.
  • Easy to edit and reuse.

Example

print("Welcome to Python")
print("CBSE Class 11")

Interactive Mode vs Script Mode

Interactive Mode Script Mode
Statement-by-statement execution Entire program execution
Output immediately Output after running the program
Cannot save programs easily Programs are saved as .py files
Best for testing Best for developing applications

Structure of a Python Program

A Python program consists of one or more statements written in a logical sequence. It may include comments, variables, input statements, processing, and output statements.

Example

# Program to calculate sum

num1 = 20
num2 = 30

total = num1 + num2

print("Sum =", total)

Your First Python Program

Program

print("Hello, World!")

Output

Hello, World!

Real-Life Applications

Application Python Usage
Online Shopping Website development
Banking Automation and reporting
Education Learning programming
Artificial Intelligence Machine learning applications
Scientific Research Data analysis

Common Errors

Mistake Correct Concept
Python is a compiled language. Python is an interpreted language.
Interactive Mode saves programs automatically. Programs should be saved separately in Script Mode.
Python only works on Windows. Python runs on multiple operating systems.
Python is only used for web development. Python is used in AI, Data Science, Automation, Web Development, Education, and many other fields.

Quick Revision

Concept Remember
Developer Guido van Rossum
Released 1991
Language Type High-level, interpreted
Execution Modes Interactive and Script
IDLE Integrated Development and Learning Environment
File Extension .py

CBSE Exam Tips

  • Remember the two execution modes and their differences.
  • Know the full form of IDLE.
  • Be able to explain why Python is considered beginner-friendly.
  • Practice writing and running simple Python programs.
  • Understand the basic structure of a Python program.

Summary

Python is a simple, powerful, and versatile programming language widely used across different industries. Its easy syntax, portability, and extensive library support make it one of the most popular programming languages for beginners and professionals alike. Python programs can be executed using Interactive Mode or Script Mode, and Python IDLE provides a convenient environment for writing and running programs. Learning these basics builds a strong foundation for studying variables, operators, control statements, lists, dictionaries, and NumPy in later chapters.