MCS-201 · Unit 9

Introduction to Python

Section 3 of 7

Block 3 · Unit 9Introduction to Python9 min · Section 3 of 7

9.3Why Python: Application Areas

Covers IGNOU MCS-201 §9.3

A language is worth learning when it opens doors. This section surveys the main areas where Python is used and the reasons it has become popular in each.

  • Easy to learn and read: simple syntax and indentation-based blocks make programs short and clear.
  • Fast development: no compile step, no declarations, rich built-in data types.
  • Huge ecosystem: the Python Package Index (PyPI) hosts several hundred thousand third-party packages, installed with the pip tool.
  • Cross-platform: the same source runs on Windows, Linux and macOS wherever an interpreter is installed.
  • Glue language: it calls easily into fast code written in C, C++ or Fortran, so heavy computation can run at C speed while the program logic stays in Python.

Application areas

AreaWhat Python does thereTypical tools
Artificial intelligence and machine learningTrain and use models that learn from datascikit-learn, TensorFlow, PyTorch, Keras
Data science and visualisationClean, analyse and plot dataNumPy, pandas, Matplotlib, Seaborn
Web developmentServer-side logic, APIs, database-backed sitesDjango, Flask, FastAPI
Automation and scriptingRename files, process reports, call web APIs, test softwareStandard library (os, pathlib, csv, json), Selenium
Mobile and desktop applicationsCross-platform graphical appsKivy, BeeWare, Tkinter, PyQt
Embedded systems and IoTControl sensors and devicesMicroPython, CircuitPython; Python on Raspberry Pi computers
Game development2D games and prototypes; scripting inside larger gamesPygame, Pyglet
Web scrapingCollect structured data from websitesScrapy, Beautiful Soup, Requests

Well-known users include YouTube, Instagram, Dropbox, Spotify and NASA. Games such as Civilization IV and Disney’s Toontown Online used Python for their game logic.

Key takeaways

  • Python is popular for readability, fast development, cross-platform support and its huge ecosystem.
  • Major areas: AI/ML, data science, web, automation, mobile/desktop, embedded, games, scraping.
  • Libraries are installed from PyPI with pip.
  • Heavy computation is usually done by C or C++ code that Python calls.

Practice questions

Answer on paper first, then check. The explanation matters more than the letter you chose.

Question 1 · multiple choice

Which tool is used to install third-party Python packages from PyPI?

Show answer

Answer: B. pip

pip downloads and installs packages from the Python Package Index, for example pip install pandas.

Question 2 · multiple choice

Which pair are web frameworks?

Show answer

Answer: C. Django and Flask

Django and Flask build web applications. The other pairs are for numerical data, mobile apps and games respectively.

Question 3 · multiple choice

What does this program print?

Python · quiz_marks.py
marks = [45, 82, 67, 90]
print(max(marks) - min(marks), len([m for m in marks if m >= 60]))
Show answer

Answer: D. 45 3

90 − 45 = 45, and three marks (82, 67, 90) are at least 60.

Question 4 · multiple choice

Which implementation is used to run Python on microcontrollers?

Show answer

Answer: C. MicroPython

MicroPython is a compact Python 3 implementation designed for microcontrollers with little memory.

Question 5 · multiple choice

Why is Python called a “glue language”?

Show answer

Answer: A. It easily connects to and controls code written in other languages such as C and C++

Python programs commonly call fast libraries written in compiled languages, combining their speed with Python’s convenience.

Question 6 · short answer

Suggest Python tools for a project that collects product prices from websites, analyses the trends, and shows them on a web page, and say what each tool does.

Show worked answer

Scrapy (or Requests with Beautiful Soup) to crawl the websites and extract the prices; pandas to clean the data and calculate trends, with NumPy underneath for the numerical work; Matplotlib or Seaborn to draw the charts; and Django or Flask to build the web page that displays the results.

↑ ↓ move↵ openTab switch type