# Learning Objectives for Days 21–30 of the 30 Days of Python Challenge

> Master Days 21-30 of 30 Days of Python challenge. Learn OOP, web scraping, data analysis, web frameworks, databases and API deployment to build real-world applications.

- Repository: [Asabeneh/30-Days-Of-Python](https://github.com/Asabeneh/30-Days-Of-Python)
- Tags: tutorial
- Published: 2026-03-06

---

**Days 21 through 30 of the 30 Days of Python challenge transition from foundational syntax to professional application development, covering object-oriented programming, web scraping, data analysis, web frameworks, database integration, and API deployment.**

The Asabeneh/30-Days-Of-Python repository structures its final ten days as a progressive path toward real-world Python engineering. These modules move beyond scripts into object-oriented design, external data acquisition, and production deployment concepts, with each day's objectives defined in dedicated markdown files within the repository.

## Day 21 – Classes and Objects

According to [`21_Day_Classes_and_objects/21_classes_and_objects.md`](https://github.com/Asabeneh/30-Days-Of-Python/blob/main/21_Day_Classes_and_objects/21_classes_and_objects.md), this module establishes that **everything in Python is an object** and teaches you to create reusable blueprints using the `class` keyword with **CamelCase** naming conventions.

You will learn to instantiate objects, define constructors using `__init__`, and manipulate instance attributes. The day covers implementing object methods with default parameters, modifying class defaults, and applying **inheritance** with `super()` to build extensible class hierarchies.

```python
class Person:
    def __init__(self, name, age):
        self.name = name
        self.age = age
    
    def info(self):
        return f"{self.name} is {self.age} years old"

class Student(Person):
    def __init__(self, name, age, student_id):
        super().__init__(name, age)
        self.student_id = student_id
    
    def info(self):
        base = super().info()
        return f"{base}, ID: {self.student_id}"

```

## Day 22 – Web Scraping

The objectives in [`22_Day_Web_scraping/22_web_scraping.md`](https://github.com/Asabeneh/30-Days-Of-Python/blob/main/22_Day_Web_scraping/22_web_scraping.md) focus on automated data extraction using `requests` and `beautifulsoup4`.

You will fetch web pages, inspect HTTP status codes, and parse raw HTML with **BeautifulSoup** to locate elements by tags, classes, IDs, and attributes. The module emphasizes extracting structured data from tables or lists and transforming results into JSON or CSV formats.

```python
import requests
from bs4 import BeautifulSoup

url = 'https://example.com'
response = requests.get(url)
soup = BeautifulSoup(response.content, 'html.parser')

# Extract all headings

headings = soup.find_all('h2')
for heading in headings:
    print(heading.get_text())

```

## Day 23 – Virtual Environments

As documented in [`23_Day_Virtual_environment/23_virtual_environment.md`](https://github.com/Asabeneh/30-Days-Of-Python/blob/main/23_Day_Virtual_environment/23_virtual_environment.md), this day teaches **environment isolation** using `venv` (or `conda`) to prevent package conflicts between projects.

You will create and activate virtual environments, install and upgrade packages inside isolated contexts, and freeze dependencies to a [`requirements.txt`](https://github.com/Asabeneh/30-Days-Of-Python/blob/main/requirements.txt) file for environment reproduction.

```bash

# Create virtual environment

python -m venv venv

# Activate (Linux/Mac)

source venv/bin/activate

# Activate (Windows)

venv\Scripts\activate

# Install packages and save dependencies

pip install requests pandas
pip freeze > requirements.txt

```

## Day 24 – Statistics

The [`24_Day_Statistics/24_statistics.md`](https://github.com/Asabeneh/30-Days-Of-Python/blob/main/24_Day_Statistics/24_statistics.md) file outlines objectives for analyzing datasets using Python's built-in `statistics` module and custom algorithms.

You will calculate **mean, median, mode, variance, and standard deviation** using library functions, then implement custom utilities for percentiles, range calculation, and frequency distribution tables.

```python
import statistics

data = [2, 4, 4, 4, 5, 5, 7, 9]

mean = statistics.mean(data)
median = statistics.median(data)
stdev = statistics.stdev(data)

# Custom percentile function

def percentile(data, percent):
    size = len(data)
    sorted_data = sorted(data)
    index = int(size * percent / 100)
    return sorted_data[index]

```

## Day 25 – Pandas

According to [`25_Day_Pandas/25_pandas.md`](https://github.com/Asabeneh/30-Days-Of-Python/blob/main/25_Day_Pandas/25_pandas.md), this module introduces **data manipulation** using the Pandas library for professional analytics workflows.

Objectives include loading data from CSV, Excel, and JSON files using `read_*` functions, cleaning datasets by handling missing values and renaming columns, and conducting exploratory data analysis with `describe()`, filtering, grouping, and aggregation methods.

```python
import pandas as pd

# Load and inspect data

df = pd.read_csv('data.csv')
print(df.describe())

# Data cleaning

df_clean = df.dropna().rename(columns={'old_name': 'new_name'})

# Grouping and aggregation

grouped = df_clean.groupby('category')['value'].mean()

```

## Day 26 – Python Web Development

The [`26_Day_Python_web/26_python_web.md`](https://github.com/Asabeneh/30-Days-Of-Python/blob/main/26_Day_Python_web/26_python_web.md) file introduces the **Flask micro-framework** for building web applications and RESTful services.

You will define routes, render templates, handle HTTP requests, and build a simple REST API. The module includes testing endpoints using `curl` or Postman and discusses local deployment strategies.

```python
from flask import Flask, jsonify, request

app = Flask(__name__)

@app.route('/api/data', methods=['GET'])
def get_data():
    return jsonify({'status': 'success', 'data': [1, 2, 3]})

@app.route('/api/data', methods=['POST'])
def post_data():
    content = request.json
    return jsonify({'received': content}), 201

if __name__ == '__main__':
    app.run(debug=True)

```

## Day 27 – Python with MongoDB

As specified in [`27_Day_Python_with_mongodb/27_python_with_mongodb.md`](https://github.com/Asabeneh/30-Days-Of-Python/blob/main/27_Day_Python_with_mongodb/27_python_with_mongodb.md), this day covers **NoSQL database integration** using the `pymongo` driver.

You will connect to local or remote MongoDB servers, perform CRUD operations on collections using both simple and complex queries, serialize Python objects to BSON format, and explore indexing strategies for query optimization.

```python
from pymongo import MongoClient

client = MongoClient('localhost', 27017)
db = client['school_database']
students = db['students']

# Create

students.insert_one({'name': 'Alice', 'grade': 95, 'subjects': ['Math', 'Science']})

# Read

top_students = students.find({'grade': {'$gte': 90}})

# Update

students.update_one({'name': 'Alice'}, {'$set': {'grade': 96}})

```

## Day 28 – Building an API

The objectives in [`28_Day_API/28_API.md`](https://github.com/Asabeneh/30-Days-Of-Python/blob/main/28_Day_API/28_API.md) focus on **RESTful API design** principles and implementation using Flask-RESTful or FastAPI.

You will design resource schemas, implement proper HTTP verbs and status codes, validate requests, and document endpoints using Swagger/OpenAPI specifications. Testing methodologies using the `requests` library are also covered.

```python
from flask import Flask
from flask_restful import Api, Resource, reqparse

app = Flask(__name__)
api = Api(app)

parser = reqparse.RequestParser()
parser.add_argument('name', required=True, help='Name cannot be blank')

class User(Resource):
    def get(self, user_id):
        return {'user': user_id, 'data': 'retrieved'}
    
    def post(self):
        args = parser.parse_args()
        return {'message': f'User {args["name"]} created'}, 201

api.add_resource(User, '/user', '/user/<string:user_id>')

```

## Day 29 – Advanced API Projects

According to [`29_Day_Building_API/29_building_API.md`](https://github.com/Asabeneh/30-Days-Of-Python/blob/main/29_Day_Building_API/29_building_API.md), this module advances to **production-grade API development** with external integrations and security.

You will construct APIs that consume external data sources, implement authentication mechanisms using API keys or token-based systems (JWT), deploy applications to cloud platforms like Heroku or Render, and configure logging for monitoring.

## Day 30 – Conclusions and Next Steps

The final module, [`30_Day_Conclusions/30_conclusions.md`](https://github.com/Asabeneh/30-Days-Of-Python/blob/main/30_Day_Conclusions/30_conclusions.md), provides a comprehensive review of the 30-day journey and establishes a roadmap for continued growth.

Learning objectives include reinforcing core concepts through a structured checklist, identifying project ideas for portfolio development, and preparing for technical interviews. The module emphasizes contributing to open-source projects and building a public portfolio that showcases the progression from Day 1 through Day 29.

## Summary

- **Object-Oriented Foundation**: Day 21 establishes class design, inheritance, and the `super()` function for reusable code architectures.
- **Data Engineering**: Days 22, 24, and 25 cover web scraping, statistical analysis, and Pandas manipulation for data science workflows.
- **Environment Management**: Day 23 teaches isolation via `venv` and dependency management through [`requirements.txt`](https://github.com/Asabeneh/30-Days-Of-Python/blob/main/requirements.txt).
- **Web and API Development**: Days 26, 28, and 29 progress from basic Flask routes to documented REST APIs with authentication and cloud deployment.
- **Database Integration**: Day 27 provides hands-on experience with MongoDB CRUD operations using `pymongo`.
- **Career Preparation**: Day 30 consolidates knowledge into actionable next steps for portfolio building and continued learning.

## Frequently Asked Questions

### What prerequisites are needed for Days 21–30 of the 30 Days of Python?

You should complete Days 1–20 or possess equivalent knowledge of Python fundamentals including loops, functions, lists, dictionaries, and file handling. The later days assume familiarity with basic syntax and build directly upon those foundations to introduce advanced libraries and frameworks.

### Which databases are covered in the final days of the challenge?

The curriculum focuses specifically on **MongoDB** (NoSQL) during Day 27, teaching connection management, CRUD operations, and BSON serialization using the `pymongo` driver. SQL databases are not covered in the Days 21–30 sequence, though the API development modules (Days 28–29) discuss database integration patterns generally.

### How does the challenge teach API deployment?

Day 29 specifically addresses deployment by guiding you through cloud platform integration (Heroku, Render), environment variable configuration for production, and authentication implementation using API keys or tokens. The module emphasizes logging and monitoring as critical components of deployed services.

### Is web scraping legal according to the challenge materials?

Day 22 emphasizes ethical and legal considerations, teaching you to inspect [`robots.txt`](https://github.com/Asabeneh/30-Days-Of-Python/blob/main/robots.txt) files and respect website terms of service. The module focuses on fetching public data, checking HTTP status codes, and parsing HTML responsibly without overwhelming target servers with requests.