Basics of Python — Free Notes & Tutorial
Learn Python from basics to advanced — variables, loops, functions, OOP, file handling, libraries. Free Python course at SikshaSarovar.
This Basics of Python course is part of Siksha Sarovar and is 100% free for students in India — no sign-up required to read. It contains 58 structured lessons with examples, and pairs with our free online compiler and AI tutor.
What you will learn
- Python syntax
- Loops
- Functions
- OOP
- File handling
Course content (58 lessons)
- 1. Introduction — Programming is the process of giving instructions to a computer so that it can perform specific tasks. These instructions are written using programming languages. Over time,…
- 1.1 The New Age of Programming — The term “New Age of Programming” refers to the modern approach to software development where the focus is on solving problems efficiently rather than writing complex code .…
- 1.2 MATLAB — MATLAB is a high-level programming environment mainly used for numerical and scientific computations . What is MATLAB? MATLAB stands for Matrix Laboratory . It is designed for: •…
- 2. What is Python? — Python is a high-level, general-purpose programming language that is designed to be simple, readable, and powerful . It allows programmers to write programs using fewer lines of…
- 2.1 Introduction to Python — Python was created by Guido van Rossum and first released in 1991 . The main goal behind Python was to create a language that: • Is easy to learn • Uses clear and readable syntax…
- 2.1.1 Interpreted vs Compiled — Programming languages are mainly classified into Interpreted and Compiled languages. Interpreted Language In interpreted languages: • Code is executed line by line • Errors are…
- 2.2 Python Packages — A package in Python is a collection of modules that are grouped together to perform related tasks. • Package → Collection of modules • Module → Collection of functions and classes…
- 2.2.1 Scientific Packages — Python is very popular in scientific computing because of powerful packages. Important Scientific Packages 1. NumPy : Supports arrays and matrices; Fast numerical operations. 2.…
- 3. Anaconda — Anaconda is a free and open-source Python distribution that is specially designed for data science, scientific computing, machine learning, and analytics . Instead of installing…
- 3.2 Components of Anaconda — Anaconda consists of several important components: 1. Python Interpreter • Core Python language • Executes Python programs 2. Conda (Package Manager) Conda is used to install…
- 3.3 Advantages of Anaconda — 1. Easy Installation : Single installer; No manual setup. 2. Beginner-Friendly : GUI-based tools; Less command-line usage. 3. Environment Management : Avoids dependency issues. 4.…
- 3.4 Anaconda vs Normal Python — Feature Normal Python Anaconda :--- :--- :--- Installation Manual One-click Libraries Installed separately Pre-installed Package manager pip conda Environment management Limited…
- 3.5 Usage & Installation — 3.5 When Should You Use Anaconda? Recommended when: • You are learning Python for data science • You need scientific libraries • You want fewer setup issues • You are a beginner…
- 4. Python Editors (IDEs) — A Python Editor or IDE (Integrated Development Environment) is software that helps programmers to: • Write Python code • Execute programs • Debug errors • Manage projects…
- 4.1 Python IDLE — IDLE stands for Integrated Development and Learning Environment . It is the default editor that comes with Python installation. Features • Simple interface • Built-in Python shell…
- 4.2 Visual Studio Code — Visual Studio Code (VS Code) is a lightweight but powerful source code editor developed by Microsoft. Features • Supports Python via extensions • Code completion • Integrated…
- 4.3 Spyder — Spyder is an IDE designed specifically for scientific computing and data analysis . Key Features • MATLAB-like interface • Variable explorer • Powerful editor • Integrated…
- 4.4 Visual Studio — Visual Studio is a full-featured IDE by Microsoft. Features • Supports Python with plugins • Advanced debugging • Suitable for large applications Use Case : Enterprise-level…
- 4.5 PyCharm — PyCharm is a Python-specific IDE developed by JetBrains. Features • Intelligent code completion • Advanced debugging • Virtual environment support • Django and Flask support…
- 4.6 Wing Python IDE — Wing IDE is designed for professional Python developers . Features • Advanced debugger • Code intelligence • Large project support Limitations : Not beginner-friendly; Paid…
- 4.7 Jupyter Notebook — Jupyter Notebook is an interactive web-based environment where code, output, text, and visuals appear together. Features • Cell-based execution • Supports graphs and equations •…
- 5. Resources — Learning Python effectively requires using the right learning resources . Python has one of the largest learning ecosystems among programming languages. 5.1 Official Python…
- 5.2 Online Learning Resources — Python learners commonly use: • Online tutorials • Video lectures • Coding practice platforms • Community forums Benefits: • Self-paced learning • Free or low-cost • Practical…
- 5.3 Books and Study Material — Books provide: • Structured learning • Conceptual clarity • Exam-oriented explanations Python books are widely used in Universities , Competitive exams , and Research work .
- 5.4 Community Support — Python has strong community support through: • Discussion forums • Developer groups • Open-source contributions This helps beginners to solve errors quickly , learn best practices…
- 6. Installing Python — Before writing Python programs, Python must be installed on the system. Python can be installed in multiple ways , depending on user needs. Different Ways to Install Python 1.…
- 6.1 Python Windows Store App — What is Python Store App? On Windows systems, Python can be installed directly from the Microsoft Store . Advantages : Very easy installation; Automatic updates;…
- 6.2 Installing Anaconda — Anaconda is preferred for Data science , Scientific computing , and Machine learning . What Anaconda Installation Provides • Python interpreter • Scientific libraries • Conda…
- 6.3 Installing Visual Studio Code — VS Code is not Python itself , but an editor used to write and run Python programs. Steps Conceptually 1. Install VS Code 2. Install Python 3. Add Python extension 4. Start coding…
- 7. Start Using Python — After installing Python, the next step is to start using it practically . Python can be used in different ways: • Using an IDE • Using Python Shell (interactive mode) • Using…
- 7.1 Python IDE — A Python IDE provides a complete environment to: • Write Python code • Execute programs • Debug errors • Manage files and projects Examples : Python IDLE, VS Code, Spyder,…
- 7.2 My First Python Program — The first program traditionally written in any programming language is Hello World . First Python Program print("Hello, World!") Explanation • print() → built-in function •…
- 7.3 Python Shell — The Python Shell is an interactive mode where: • Code is executed line by line • Results are shown immediately • Useful for testing small commands Example Advantages : Immediate…
- 7.4 Running Python from the Console — Python programs can also be run using the system console . • Windows → Command Prompt / PowerShell • macOS / Linux → Terminal Why Use Console Mode • Faster execution • Useful for…
- 7.4.1 Opening Console (macOS) — Steps: 1. Open Terminal 2. Type: python3 3. Python shell starts
- 7.4.2 Opening Console (Windows) — Steps: 1. Open Command Prompt 2. Type: python 3. Python shell starts
- 7.4.3 Add Python to PATH — PATH is an environment variable that allows the system to find Python from any directory. Why Add Python to PATH • Run Python from anywhere • Avoid “Python not recognized” error ✔…
- 7.5 Scripting Mode — In Scripting Mode , Python programs are: • Written in .py files • Saved permanently • Executed multiple times Difference Between Shell and Script Mode Shell Mode Script Mode :---…
- 7.5.1 Run from IDLE — Steps: 1. Open IDLE 2. File → New File 3. Write program 4. Save with .py 5. Run → Run Module
- 7.5.2 Run from Terminal (macOS) — python3 hello.py
- 7.5.3 Run from CMD (Windows) — python hello.py
- 7.5.4 Run from Spyder — Steps: 1. Open Spyder 2. Write code 3. Click Run button 4. Output appears in console
- 8. Basic Python Programming — This topic forms the foundation of Python . Almost all programs are built using these basic concepts. Python programs are made up of: • Statements • Variables • Data values •…
- 8.1.1 Get Help in Python — Python provides built-in help functionality . Using help() help(print) Shows function usage, description, and parameters. Using dir() dir(str) Displays all methods of string type.…
- 8.2 Variables — A variable is a name used to store data in memory. Creating Variables x = 10 name = "Rohit" Key Features • No need to declare data type • Type is decided at runtime ( Dynamic…
- 8.2.1 Numbers — Python supports different types of numbers. Types of Numbers 1. Integer ( int ) : a = 10 2. Floating-point ( float ) : b = 3.14 3. Complex ( complex ) : c = 2 + 3j Arithmetic…
- 8.2.2 Strings — A string is a sequence of characters enclosed in quotes. • 'Single' • "Double" • '''Multi-line''' String Operations • Concatenation : "Hello" + "World" • Indexing : "Python"[0]…
- 8.2.3 String Input — Python uses input() to take input from user. Input Always Returns String To use it as a number, you must convert it. age = input("Enter age: ") age = int(age)
- 8.3 Built-in Functions — Python provides many built-in functions . Common Built-in Functions Function Purpose :--- :--- print() Display output input() Take input type() Find data type len() Length of…
- 8.4 Standard Library — The Standard Library is a collection of pre-written modules that come with Python. Examples • math : mathematical operations • random : random numbers • datetime : date and time •…
- 8.5 Using Libraries — Module A single Python file containing functions. Package A collection of modules organized in directories. Library A collection of packages and modules. Example from math import…
- 9. Plotting in Python — Plotting means representing data in graphical form so that information can be: • Easily understood • Quickly analyzed • Clearly compared Python provides powerful plotting…
- 9.2 Matplotlib Library — Matplotlib is the most popular Python library for plotting graphs . What is Matplotlib? A data visualization library to create 2D graphs, charts, and diagrams. It produces…
- 9.3 Basic Plotting — Before plotting, the library must be imported: import matplotlib.pyplot as plt • pyplot : plotting module • plt : alias name Simple Line Plot Example • plot() : creates line graph…
- 9.4 Types of Plots — Matplotlib supports various types of plots: 1. Line Plot : Shows trends over time 2. Bar Chart : Compares categories 3. Histogram : Shows data distribution 4. Scatter Plot : Shows…
- 9.5 Adding Labels and Title — Graphs become meaningful when labels are added. Syntax plt.xlabel("X Axis") plt.ylabel("Y Axis") plt.title("Sample Graph") Complete Example
- 9.6 Subplots — Subplots allow multiple graphs to be displayed in one window . Creating Subplots plt.subplot(rows, columns, position) Example : plt.subplot(1, 2, 1) → 1 row, 2 cols, 1st graph…
- 9.7 Advantages & Exercises — 9.7 Advantages of Plotting • Easy data visualization • Improves data understanding • Saves time in analysis • Professional presentation 9.8 Common Errors • Forgetting plt.show() •…
1. Introduction
Programming is the process of giving instructions to a computer so that it can perform specific tasks. These instructions are written using programming languages. Over time, programming languages have evolved from low-level, hardware-dependent languages to high-level, user-friendly languages.
Python belongs to the category of modern programming languages that focus on:
• Ease of learning • Readability • Productivity • Real-world problem solving
This makes Python suitable for students, researchers, and professionals.
1.1 The New Age of Programming
The term “New Age of Programming” refers to the modern approach to software development where the focus is on solving problems efficiently rather than writing complex code.
Already Programming Era
In earlier times:
• Programming languages were hardware dependent • Syntax was complex • Writing even small programs required many lines of code • Development time was high
Examples: Assembly Language, Early versions of C
Modern Programming Era
Modern programming emphasizes:
• Human-readable syntax • Rapid development • Code reusability • Cross-platform execution
Python is a key representative of this new era.
Why Python is a New Age Language
- High-level abstraction: Programmer does not worry about memory management.
- Simple syntax: Code looks similar to English.
- Multi-domain usage: Web, Data Science, AI, Automation, Scientific computing.
- Community-driven growth: Thousands of open-source libraries.
Advantages of New Age Programming (Python)
| Feature | Description |
|---|---|
| Readability | Easy to understand and learn |
| Productivity | Faster development |
| Portability | Runs on Windows, macOS, Linux |
| Scalability | Suitable for small & large projects |
| Integration | Works with other languages |
Frequently asked questions
Is the Basics of Python course really free?
Yes. The entire Basics of Python course on Siksha Sarovar is free to read with no account required. You can optionally sign in with Google to save your progress.
Do I get a certificate for Basics of Python?
Yes — finish the lessons and pass the quiz to earn a free, verifiable certificate you can share on LinkedIn or with recruiters.
Can I run code while learning?
Yes. The built-in online compiler runs C, C++, Python, Java, PHP, JavaScript, C# and SQL directly in your browser — no installation needed.