Introduction to Python
On This Page
Module 1: Introduction to Python
1.1 What is Python?
Python is a high-level, general-purpose programming language created by Guido van Rossum and first released in 1991. It is known for its clean, readable syntax that closely resembles the English language, which makes it one of the easiest programming languages for absolute beginners to learn.
Unlike many other programming languages that require complex punctuation and rigid formatting, Python focuses on readability. This is why Python is often described as a language that reads almost like plain English instructions.
✓ Simple Analogy
Think of Python like giving instructions to a very obedient assistant in plain, step-by-step language. You don't need to speak in complicated code — you just tell it clearly what to do, one step at a time, and it executes exactly that.
Key Characteristics of Python
- Interpreted: Code runs line-by-line, without a separate compilation step.
- Dynamically Typed: You don't need to declare data types explicitly.
- Object-Oriented: Supports classes, objects, and OOP concepts.
- Open Source & Free: Anyone can use, modify, and distribute it.
- Huge Ecosystem: Thousands of libraries for every use case imaginable.
- Cross-Platform: Runs on Windows, macOS, and Linux without changes.
1.2 History of Python
Python's development began in the late 1980s at Centrum Wiskunde & Informatica (CWI) in the Netherlands, where Guido van Rossum wanted to create a successor to the ABC language that fixed its limitations while keeping its readability.
| Year | Milestone |
|---|
| 1989 | Guido van Rossum begins working on Python as a hobby project |
| 1991 | Python 0.9.0 released publicly — first public release |
| 1994 | Python 1.0 released with functional programming tools |
| 2000 | Python 2.0 released — introduced list comprehensions, garbage collection |
| 2008 | Python 3.0 released — major redesign, not backward compatible |
| 2020 | Python 2 officially retired (End of Life) |
| 2026 | Python 3.13+ widely used across AI, Data Science, and Web Development |
The name "Python" was not inspired by the snake — Guido named it after the British comedy show Monty Python's Flying Circus, which he was a fan of.
1.3 Why Python for Data Analytics?
Python has become the number one language for Data Analytics and Data Science worldwide. Here is why every analytics professional is expected to know Python:
- Powerful Libraries: NumPy, Pandas, Matplotlib, Seaborn, Scikit-learn built specifically for data work.
- Easy to Learn: Simple syntax means faster onboarding for non-programmers, analysts, and business teams.
- Handles Any Data Size: From a 10-row Excel sheet to millions of rows of transactional data.
- Automation Ready: Automate reporting, dashboards, data cleaning, and Excel/Email tasks.
- Industry Standard: Used at Google, Netflix, Amazon, Spotify, and virtually every data-driven company.
- Strong Community & Job Market: High demand, high salaries, huge community support online.
ℹ Why This Matters For Your Career
Recruiters actively search for "Python + Excel + SQL" combination skills for Data Analyst roles. Learning Python is no longer optional for analytics careers — it is the baseline expectation.
1.4 Real-World Applications of Python
| Domain | How Python Is Used |
|---|
| Data Analytics | Cleaning, analyzing, and visualizing business data |
| Web Development | Building websites/backends using Django, Flask |
| Artificial Intelligence | Machine Learning, Deep Learning, NLP, Computer Vision |
| Automation | Automating Excel reports, emails, file management |
| Finance | Algorithmic trading, risk analysis, forecasting |
| Game Development | Simple 2D games using Pygame |
| Cybersecurity | Building security tools and penetration testing scripts |
1.5 Career Opportunities After Learning Python
- Data Analyst — Cleaning, analyzing and reporting on business data
- Data Scientist — Building predictive models and ML solutions
- Business Analyst — Data-driven decision support for management
- Python Developer — Backend and automation development
- Machine Learning Engineer — Building and deploying AI models
- Automation / RPA Developer — Automating repetitive business processes
✓ Instructor Tip
Share real LinkedIn job postings for "Data Analyst" roles with your students during this session — seeing genuine listings that require Python significantly increases motivation and buy-in.
1.6 Installing Python (Windows / Mac)
Step-by-Step Installation on Windows:
- Go to the official website: python.org/downloads
- Click the yellow "Download Python" button (latest stable version)
- Run the downloaded .exe installer
- IMPORTANT: Check the box "Add Python to PATH" before clicking Install
- Click "Install Now" and wait for setup to complete
- Verify installation by opening Command Prompt and typing: python --version
✗ Common Mistake
Students frequently forget to check "Add Python to PATH" during installation. This causes the "'python' is not recognized" error later. If this happens, simply reinstall and tick that checkbox.
Step-by-Step Installation on macOS:
- Download the macOS installer (.pkg file) from python.org/downloads
- Open the .pkg file and follow the installation wizard
- Verify installation using Terminal: python3 --version
1.7 Installing VS Code
Visual Studio Code (VS Code) is a free, lightweight, and highly popular code editor developed by Microsoft. It is widely used by professional Python developers.
- Download from: code.visualstudio.com
- Install and open VS Code
- Go to Extensions (left sidebar) and search for "Python" by Microsoft
- Click Install — this enables IntelliSense, debugging, and syntax highlighting
1.8 Installing Jupyter Notebook
Jupyter Notebook is the most popular tool among Data Analysts because it allows you to write and run code in small, independent blocks called cells, and instantly see outputs, charts, and tables right below the code.
pip install notebook
# To launch Jupyter Notebook:
jupyter notebook
1.9 Installing Anaconda
Anaconda is an all-in-one distribution that comes pre-loaded with Python, Jupyter Notebook, and the most important Data Analytics libraries (NumPy, Pandas, Matplotlib) already installed — saving beginners from installing each library manually.
- Download from: anaconda.com/download
- Run the installer with default settings
- Open "Anaconda Navigator" from the Start Menu
- Launch Jupyter Notebook directly from the Navigator dashboard
✓ Recommendation for Beginners
For classroom training, install Anaconda instead of plain Python — it saves significant setup time since Pandas, NumPy, and Jupyter come pre-installed.
1.10 Running Your First Python Program
Let's write the traditional first program every programmer starts with:
# My first Python program
print("Hello, World!")
print("Welcome to Samantus Python for Data Analytics")
Output
Hello, World!
Welcome to Samantus Python for Data Analytics
How to run this program:
- Save the file as hello.py
- Open Terminal / Command Prompt in the same folder
- Type: python hello.py and press Enter
- Alternatively, run it directly inside Jupyter Notebook or VS Code
ℹ Note
The print() function displays output on the screen. You will use it constantly throughout this course to check your code's results.
1.11 Practical Exercises
Basic (5 Questions)
1. Write a program to print your name and course name.
2. Print "I am learning Python for Data Analytics" three times.
3. Check your installed Python version using the terminal.
4. Open Jupyter Notebook and run a print statement in a cell.
5. Create a new folder named 'python_practice' and save hello.py inside it.
Intermediate (5 Questions)
1. Install VS Code and configure the Python extension.
2. Create a Python file that prints a multi-line welcome message using triple quotes.
3. Explain in your own words the difference between Python 2 and Python 3.
4. Research and list 3 companies that use Python, with the department that uses it.
5. Install Anaconda and open Anaconda Navigator successfully.
Advanced (5 Questions)
1. Research why Python is interpreted rather than compiled, and note one pro and one con of this.
2. Compare Jupyter Notebook vs VS Code for data analytics work — when would you use each?
3. Find out what "PEP 8" is and write 3 rules it defines.
4. Explain what "open source" means and why it matters for Python's growth.
5. Create a short 5-line presentation explaining why you are learning Python for your career.
1.12 Module Quiz (MCQs)
Q1. Who created Python?
- (a) Dennis Ritchie
- (b) Guido van Rossum
- (c) James Gosling
- (d) Bjarne Stroustrup
Q2. In which year was Python first publicly released?
- (a) 1989
- (b) 1991
- (c) 1995
- (d) 2000
Q3. Python is best described as:
- (a) Compiled only
- (b) Interpreted, high-level
- (c) Machine language
- (d) Markup language
Q4. Which tool comes bundled with Anaconda?
- (a) Only Python
- (b) Jupyter Notebook + Libraries
- (c) Only VS Code
- (d) Only Excel
Q5. Which function is used to display output in Python?
- (a) display()
- (b) show()
- (c) print()
- (d) output()
ℹ Answer Key
1-b, 2-b, 3-b, 4-b, 5-c
1.13 Module Assignment
Assignment: Setup & First Program Documentation
- Install Python, VS Code, and Anaconda on your personal laptop/PC.
- Take screenshots of each successful installation (version check output).
- Write and run a Python program that prints your full name, course name, and today's date as plain text.
- Submit a 1-page document (Word or PDF) with your screenshots and the program's screenshot output.
Expected Output: A short report showing successful installation proof and one working Python program with correct output — proving your development environment is ready for Module 2.
1.14 Interview Questions — Module 1
- Q: What is Python and why is it popular?
A: Python is a high-level, interpreted, general-purpose language known for readable syntax and a vast ecosystem of libraries, making it popular for data analytics, AI, automation, and web development. - Q: What is the difference between Python 2 and Python 3?
A: Python 3 is the actively maintained version with improved Unicode support, print as a function, and modern language features; Python 2 reached end-of-life in 2020. - Q: Is Python compiled or interpreted?
A: Python is primarily interpreted — code executes line by line via the Python interpreter, though it is internally compiled to bytecode first. - Q: Name three real-world use cases of Python.
A: Data analytics/dashboards, AI/ML model building, and workflow/report automation are three common real-world applications.
1.15 Student Notes Page
Use this space to write down key points, doubts, and your own examples from today's session.