Skip to content

mirajgodha/Python-3-Bootcamp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python-3-Bootcamp: Comprehensive Documentation

Executive Overview

The Python-3-Bootcamp repository is a comprehensive learning resource designed to take learners from absolute beginner to intermediate-advanced proficiency in Python 3. This bootcamp-style course emphasizes hands-on, project-based learning with a structured progression through fundamental concepts to advanced programming techniques.

Repository URL: https://github.com/mirajgodha/Python-3-Bootcamp


Table of Contents

  1. Course Structure
  2. Prerequisites & Setup
  3. Module Breakdown
  4. Learning Outcomes
  5. Project Portfolio
  6. Installation & Environment Setup
  7. Usage Guide
  8. Best Practices
  9. Advanced Topics
  10. Contributing & Support

Course Structure

Learning Path Architecture

The bootcamp follows a sequential, scaffolded learning approach designed to build foundational knowledge before introducing complex concepts. The curriculum is organized into distinct learning phases:

Phase 1: Foundation (Weeks 1-2)

  • Environment setup and Python installation
  • Basic syntax and data types
  • Print statements and string operations
  • Input/output operations

Phase 2: Core Fundamentals (Weeks 3-5)

  • Control flow structures (if/elif/else)
  • Loop mechanisms (for, while)
  • Data structures (lists, tuples, dictionaries, sets)
  • Function definition and usage

Phase 3: Intermediate Concepts (Weeks 6-8)

  • Object-Oriented Programming (OOP)
  • File I/O operations
  • Exception handling
  • Modules and packages

Phase 4: Advanced Topics (Weeks 9-12)

  • Decorators and closures
  • Generators and iterators
  • Lambda functions and functional programming
  • List/dict comprehensions
  • Regular expressions

Phase 5: Practical Applications (Weeks 13-16)

  • Web scraping techniques
  • API integration and HTTP requests
  • Database operations
  • Web development with Flask
  • Data analysis with Pandas and NumPy

Prerequisites & Setup

System Requirements

Minimum Requirements:

  • Operating System: Windows 10+, macOS 10.14+, or Linux (Ubuntu 18.04+)
  • RAM: 4GB minimum (8GB recommended)
  • Disk Space: 2GB for Python and dependencies
  • Internet Connection: Required for package installations

Recommended Software:

  • Code Editor: Visual Studio Code, PyCharm, or JetBrains IDE
  • Terminal: Windows PowerShell, macOS Terminal, or Linux Bash
  • Git: Version control system for repository management

Pre-Course Knowledge

No prior programming experience is required. However, familiarity with:

  • Basic computer operations (file management, terminal basics)
  • Mathematical concepts (variables, functions, algebra)
  • Problem-solving mindset will accelerate learning

Module Breakdown

Module 1: Python Fundamentals

Objectives:

  • Understand Python syntax and execution model
  • Learn variable declaration and data types
  • Master string manipulation techniques
  • Implement basic input/output operations

Key Topics:

  • Comments and documentation
  • Variables and naming conventions
  • Data Types: int, float, str, bool
  • Type conversion and casting
  • Arithmetic, comparison, and logical operators
  • String methods and formatting (f-strings, .format(), %)

Core Concepts:

# Variable assignment and basic operations
name = "Python"
version = 3.11
is_powerful = True

# String formatting
message = f"Learning {name} {version} is {is_powerful}!"
print(message)

# Type conversion
age_str = "25"
age_int = int(age_str)

Practical Exercises:

  1. Create a program that calculates BMI
  2. Build a simple temperature converter (C to F)
  3. Write a program that validates user input

Module 2: Control Flow & Decision Making

Objectives:

  • Implement conditional logic using if/elif/else
  • Understand Boolean logic and operator precedence
  • Build decision trees for complex scenarios
  • Write clean, readable control structures

Key Topics:

  • If statements and conditions
  • Elif for multiple conditions
  • Else for default cases
  • Nested conditionals
  • Ternary operators
  • Boolean logic (and, or, not)

Core Concepts:

# Conditional statements
age = 25
if age < 13:
    category = "Child"
elif age < 18:
    category = "Teen"
else:
    category = "Adult"

# Nested conditions
if age >= 18:
    if age >= 65:
        status = "Senior"
    else:
        status = "Working Age"

Practical Exercises:

  1. Build a simple calculator with validation
  2. Create a grade analyzer program
  3. Implement a login system with multiple conditions

Module 3: Loops & Iteration

Objectives:

  • Master for loops for iterating sequences
  • Implement while loops for conditional iteration
  • Control loop flow with break/continue/pass
  • Understand loop efficiency and best practices

Key Topics:

  • For loops with range() and sequences
  • While loops and termination conditions
  • Break, continue, and pass statements
  • Nested loops
  • Loop else clause
  • Enumerate and zip functions

Core Concepts:

# For loop with range
for i in range(5):
    print(f"Iteration {i}")

# For loop with sequences
names = ["Alice", "Bob", "Charlie"]
for name in names:
    print(f"Hello, {name}!")

# While loop
count = 0
while count < 5:
    print(count)
    count += 1

# Using enumerate
for index, name in enumerate(names):
    print(f"{index}: {name}")

Practical Exercises:

  1. Print multiplication tables
  2. Implement a Fibonacci sequence generator
  3. Create a number guessing game

Module 4: Data Structures

Objectives:

  • Master lists, tuples, dictionaries, and sets
  • Understand mutability and immutability
  • Implement efficient data structure operations
  • Choose appropriate structures for problems

Key Topics:

Lists

  • Creation and indexing
  • Slicing operations
  • List methods (append, extend, insert, remove, pop)
  • List comprehensions
  • Nested lists

Tuples

  • Immutable sequences
  • Tuple unpacking
  • Named tuples

Dictionaries

  • Key-value pairs
  • Dictionary methods
  • Dictionary comprehensions
  • Nested dictionaries

Sets

  • Unique elements
  • Set operations (union, intersection, difference)
  • Set methods

Core Concepts:

# Lists
fruits = ["apple", "banana", "cherry"]
fruits.append("date")
fruits_copy = fruits[1:3]  # Slicing

# List comprehension
squared = [x**2 for x in range(5)]

# Dictionaries
person = {
    "name": "Alice",
    "age": 30,
    "city": "New York"
}
person["email"] = "alice@example.com"

# Dictionary comprehension
word_lengths = {word: len(word) for word in fruits}

# Sets
unique_numbers = {1, 2, 2, 3, 3, 3}  # {1, 2, 3}

Practical Exercises:

  1. Build a contact management system with dictionaries
  2. Implement a student grade tracker
  3. Create a shopping list with duplicate removal

Module 5: Functions & Code Organization

Objectives:

  • Define and call functions effectively
  • Master function parameters and return values
  • Understand scope and variable lifetime
  • Write reusable, maintainable code

Key Topics:

  • Function definition with def
  • Parameters (positional, keyword, default)
  • *args and **kwargs
  • Return statements and multiple returns
  • Docstrings and documentation
  • Scope (local, nonlocal, global)
  • Lambda functions

Core Concepts:

# Basic function
def greet(name, greeting="Hello"):
    """Greet a person with a custom greeting."""
    return f"{greeting}, {name}!"

# *args and **kwargs
def add_numbers(*args):
    return sum(args)

def print_info(**kwargs):
    for key, value in kwargs.items():
        print(f"{key}: {value}")

# Lambda function
square = lambda x: x**2
numbers = [1, 2, 3, 4, 5]
squared_numbers = list(map(square, numbers))

Practical Exercises:

  1. Create utility functions for common operations
  2. Build a function that validates email addresses
  3. Implement a calculator with multiple operations

Module 6: Object-Oriented Programming (OOP)

Objectives:

  • Design classes and objects
  • Implement inheritance and polymorphism
  • Understand encapsulation principles
  • Build extensible, maintainable systems

Key Topics:

  • Classes and objects
  • Attributes (instance and class)
  • Methods and init
  • Inheritance and method overriding
  • Polymorphism and duck typing
  • Encapsulation (private/protected attributes)
  • Static and class methods
  • Magic methods (str, repr, len, etc.)

Core Concepts:

# Class definition
class Animal:
    def __init__(self, name, species):
        self.name = name
        self.species = species
    
    def speak(self):
        return f"{self.name} makes a sound"

# Inheritance
class Dog(Animal):
    def speak(self):
        return f"{self.name} barks!"

# Usage
dog = Dog("Buddy", "Canis familiaris")
print(dog.speak())

Practical Exercises:

  1. Design a library management system with classes
  2. Create a bank account system with inheritance
  3. Implement a game character hierarchy

Module 7: File I/O & Exception Handling

Objectives:

  • Read and write files safely
  • Handle exceptions gracefully
  • Process CSV and JSON data
  • Implement robust error handling strategies

Key Topics:

  • Opening and closing files
  • Reading (read, readline, readlines)
  • Writing and appending
  • Context managers (with statement)
  • Exception types and hierarchy
  • Try/except/finally blocks
  • Raising custom exceptions
  • CSV and JSON processing

Core Concepts:

# File operations with context manager
with open('data.txt', 'r') as file:
    content = file.read()

# Exception handling
try:
    with open('data.json', 'r') as f:
        data = json.load(f)
except FileNotFoundError:
    print("File not found!")
except json.JSONDecodeError:
    print("Invalid JSON format!")
finally:
    print("File operation complete")

# Working with CSV
import csv
with open('data.csv', 'r') as f:
    reader = csv.DictReader(f)
    for row in reader:
        print(row)

Practical Exercises:

  1. Create a data logger that writes to files
  2. Build a configuration file parser
  3. Implement a CSV to JSON converter

Module 8: Modules, Packages & Libraries

Objectives:

  • Create and import modules
  • Understand package structure
  • Use built-in libraries effectively
  • Manage external dependencies

Key Topics:

  • Module creation and import
  • Package structure (init.py)
  • Built-in modules (os, sys, datetime, math, random, collections)
  • External libraries (requests, beautifulsoup4, pandas, numpy)
  • pip and virtual environments
  • requirements.txt and dependency management

Core Concepts:

# Creating a module (mymodule.py)
def greeting(name):
    return f"Hello, {name}!"

# Using the module
import mymodule
print(mymodule.greeting("World"))

# Using built-in libraries
import datetime
import random

current_time = datetime.datetime.now()
random_number = random.randint(1, 100)

Practical Exercises:

  1. Create a custom module for utility functions
  2. Build a package with multiple modules
  3. Install and use external libraries

Module 9: Advanced Python Concepts

Objectives:

  • Master functional programming techniques
  • Implement decorators for code enhancement
  • Work with generators and iterators
  • Optimize code with advanced patterns

Key Topics:

  • Decorators and function wrappers
  • Generators and yield keyword
  • Iterator protocol
  • List/dict/set comprehensions
  • map, filter, reduce functions
  • Closures and nonlocal
  • Context managers (enter, exit)

Core Concepts:

# Decorator
def timer_decorator(func):
    def wrapper(*args, **kwargs):
        import time
        start = time.time()
        result = func(*args, **kwargs)
        end = time.time()
        print(f"Execution time: {end - start}")
        return result
    return wrapper

@timer_decorator
def slow_function():
    time.sleep(1)

# Generator
def count_up_to(n):
    i = 1
    while i <= n:
        yield i
        i += 1

# List comprehension
squared = [x**2 for x in range(10) if x % 2 == 0]

Practical Exercises:

  1. Create custom decorators for logging and timing
  2. Build a generator for data processing
  3. Optimize code using comprehensions

Module 10: Data Analysis & Scientific Computing

Objectives:

  • Work with NumPy arrays and operations
  • Analyze data with Pandas DataFrames
  • Visualize data effectively
  • Perform statistical computations

Key Topics:

  • NumPy arrays and operations
  • Pandas DataFrames and Series
  • Data cleaning and preprocessing
  • Data aggregation and grouping
  • Matplotlib and data visualization
  • Statistical analysis

Core Concepts:

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

# NumPy array operations
arr = np.array([1, 2, 3, 4, 5])
mean = np.mean(arr)
std = np.std(arr)

# Pandas DataFrame
df = pd.read_csv('data.csv')
df['new_column'] = df['column'] * 2
grouped = df.groupby('category').sum()

# Visualization
plt.plot(df['x'], df['y'])
plt.xlabel('X Axis')
plt.ylabel('Y Axis')
plt.show()

Practical Exercises:

  1. Analyze a real-world dataset
  2. Create data visualizations
  3. Perform statistical analysis on data

Module 11: Web Scraping & APIs

Objectives:

  • Extract data from web pages
  • Interact with web APIs
  • Handle HTTP requests
  • Parse JSON and HTML responses

Key Topics:

  • HTTP requests with requests library
  • HTML parsing with BeautifulSoup
  • Web scraping best practices
  • API authentication and rate limiting
  • JSON data processing
  • Error handling for network operations

Core Concepts:

import requests
from bs4 import BeautifulSoup
import json

# Making API requests
response = requests.get('https://api.example.com/data')
data = response.json()

# Web scraping
html_content = requests.get('https://example.com').text
soup = BeautifulSoup(html_content, 'html.parser')
links = soup.find_all('a')

# Error handling
try:
    response = requests.get(url, timeout=5)
    response.raise_for_status()
except requests.RequestException as e:
    print(f"Request failed: {e}")

Practical Exercises:

  1. Scrape data from a public website
  2. Build a weather data fetcher using APIs
  3. Create a news aggregator

Module 12: Web Development with Flask

Objectives:

  • Build web applications with Flask
  • Create routes and templates
  • Handle form submissions
  • Implement basic authentication

Key Topics:

  • Flask application structure
  • Routes and request handling
  • Templates with Jinja2
  • Static files (CSS, JS, images)
  • Form handling
  • Session management
  • Database integration

Core Concepts:

from flask import Flask, render_template, request

app = Flask(__name__)

@app.route('/')
def home():
    return render_template('index.html')

@app.route('/submit', methods=['POST'])
def submit():
    data = request.form.get('data')
    return f"Received: {data}"

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

Practical Exercises:

  1. Create a simple Flask application
  2. Build a form submission system
  3. Deploy a Flask app locally

Learning Outcomes

By Course Completion, Learners Will Be Able To:

Fundamental Skills:

  • Write clean, readable Python code following PEP 8 style guidelines
  • Design and implement functions with proper documentation
  • Create and manipulate data structures effectively
  • Handle errors gracefully with try/except blocks

Intermediate Skills:

  • Design object-oriented programs using classes and inheritance
  • Read and write files in multiple formats (text, CSV, JSON)
  • Create modules and packages for code organization
  • Utilize lambda functions and comprehensions for efficient code

Advanced Skills:

  • Implement decorators and generators
  • Build command-line applications
  • Scrape web data and interact with APIs
  • Develop web applications with Flask
  • Analyze data with Pandas and NumPy

Professional Skills:

  • Version control with Git
  • Virtual environment management
  • Debugging and profiling code
  • Writing tests and documentation
  • Problem-solving and algorithmic thinking

Project Portfolio

Milestone Project 1: Tic-Tac-Toe Game

Skills Applied: Loops, conditionals, data structures, functions

Objectives:

  • Implement game logic
  • Create a playable command-line interface
  • Handle user input validation
  • Check win/lose/draw conditions

Deliverables:

  • Fully functional game
  • Commented code
  • Usage documentation

Milestone Project 2: Blackjack Game

Skills Applied: OOP, loops, random module, functions

Objectives:

  • Design Card and Deck classes
  • Implement dealer logic
  • Manage game state
  • Calculate hand values

Deliverables:

  • Object-oriented design
  • Game flow implementation
  • Documentation

Milestone Project 3: Web Scraper & Data Analyzer

Skills Applied: Web scraping, data analysis, file I/O, Pandas

Objectives:

  • Scrape data from websites
  • Clean and process data
  • Perform analysis
  • Visualize results

Deliverables:

  • Working scraper
  • Data analysis script
  • Visualizations
  • Report

Capstone Project: Flask Web Application

Skills Applied: Flask, OOP, databases, web development

Objectives:

  • Build a full-stack web application
  • Implement user authentication
  • Create database models
  • Deploy application

Deliverables:

  • Working web application
  • User documentation
  • Code documentation
  • Deployment guide

Installation & Environment Setup

Step 1: Install Python

Windows:

  1. Visit https://www.python.org/downloads/
  2. Download Python 3.11+ installer
  3. Run installer, check "Add Python to PATH"
  4. Verify installation: python --version

macOS:

# Using Homebrew
brew install python3

# Verify
python3 --version

Linux (Ubuntu):

sudo apt update
sudo apt install python3 python3-pip python3-venv

# Verify
python3 --version

Step 2: Clone the Repository

git clone https://github.com/mirajgodha/Python-3-Bootcamp.git
cd Python-3-Bootcamp

Step 3: Create Virtual Environment

# Create virtual environment
python -m venv bootcamp_env

# Activate (Windows)
bootcamp_env\Scripts\activate

# Activate (macOS/Linux)
source bootcamp_env/bin/activate

Step 4: Install Dependencies

# Upgrade pip
pip install --upgrade pip

# Install requirements
pip install -r requirements.txt

# Key packages typically needed:
pip install requests
pip install beautifulsoup4
pip install pandas
pip install numpy
pip install matplotlib
pip install flask

Step 5: Verify Installation

# Create test_setup.py
import sys
print(f"Python {sys.version}")

import pandas
import numpy
import requests
import flask
print("All packages installed successfully!")

Usage Guide

Working with the Course Materials

1. Reading Files

# View a specific lesson
cat 01-Python-Basics/lesson_01.py

# Open in editor
code 01-Python-Basics/

2. Running Examples

# Navigate to module
cd 02-Control-Flow/

# Run a script
python control_flow_example.py

# Run interactive Python shell
python
>>> # Start typing Python code

3. Working with Jupyter Notebooks

# Install Jupyter
pip install jupyter

# Start Jupyter
jupyter notebook

# Open notebook in browser at http://localhost:8888

Recommended Study Workflow

Daily Routine (2-3 hours):

  1. Read the concept explanation (15-20 min)
  2. Review code examples (20-30 min)
  3. Complete practice exercises (30-45 min)
  4. Debug and test solutions (20-30 min)
  5. Review and plan next session (10 min)

Weekly Schedule:

  • Monday-Thursday: New concepts and exercises
  • Friday: Project work and integration
  • Weekend: Review and extra practice

Best Practices

Code Style & Convention

Follow PEP 8 Python Style Guide:

# Good naming conventions
student_age = 25  # lowercase with underscores
CONSTANT_VALUE = 3.14  # ALL_CAPS for constants
ClassName = "MyClass"  # PascalCase for classes

# Proper spacing and indentation
def calculate_average(numbers):
    """Calculate the average of a list of numbers."""
    total = sum(numbers)
    count = len(numbers)
    return total / count if count > 0 else 0

# Use meaningful variable names
# Bad: x = 5
# Good: student_count = 5

Documentation Standards

def process_data(data, filter_type='median'):
    """
    Process data using specified filter type.
    
    Args:
        data (list): Input data to process
        filter_type (str): Type of filter ('median', 'mean', 'mode')
    
    Returns:
        float: Processed data value
    
    Raises:
        ValueError: If filter_type is invalid
        TypeError: If data is not a list
    
    Examples:
        >>> process_data([1, 2, 3, 4, 5])
        3.0
    """
    if not isinstance(data, list):
        raise TypeError("data must be a list")
    
    if filter_type not in ['median', 'mean', 'mode']:
        raise ValueError(f"Invalid filter type: {filter_type}")
    
    # Implementation here

Testing Practices

import unittest

class TestCalculations(unittest.TestCase):
    def test_addition(self):
        self.assertEqual(add(2, 3), 5)
    
    def test_division_by_zero(self):
        with self.assertRaises(ZeroDivisionError):
            divide(10, 0)

if __name__ == '__main__':
    unittest.main()

Debugging Techniques

# Use print statements strategically
print(f"Variable state: {variable}")

# Use Python debugger
import pdb
pdb.set_trace()  # Execution pauses here

# Use assertions for validation
assert len(data) > 0, "Data cannot be empty"

# Use logging for production
import logging
logging.debug(f"Processing data: {data}")

Advanced Topics

Regular Expressions

import re

# Pattern matching
pattern = r'^\w+@\w+\.\w+$'  # Email pattern
email = "user@example.com"
if re.match(pattern, email):
    print("Valid email")

# Finding patterns
text = "The numbers are 123, 456, and 789"
numbers = re.findall(r'\d+', text)
print(numbers)  # ['123', '456', '789']

Context Managers

class FileManager:
    def __init__(self, filename, mode):
        self.filename = filename
        self.mode = mode
        self.file = None
    
    def __enter__(self):
        self.file = open(self.filename, self.mode)
        return self.file
    
    def __exit__(self, exc_type, exc_val, exc_tb):
        if self.file:
            self.file.close()

# Usage
with FileManager('data.txt', 'r') as f:
    content = f.read()

Metaclasses and Advanced OOP

class SingletonMeta(type):
    """Ensure only one instance exists."""
    _instances = {}
    
    def __call__(cls, *args, **kwargs):
        if cls not in cls._instances:
            cls._instances[cls] = super().__call__(*args, **kwargs)
        return cls._instances[cls]

class Database(metaclass=SingletonMeta):
    def __init__(self):
        self.connection = None

Contributing & Support

Getting Help

Resources:

Contributing to the Repository

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/improvement)
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request with detailed description

Reporting Issues

When reporting bugs:

  • Provide minimal code to reproduce
  • Include Python version and OS
  • Share error messages and tracebacks
  • Describe expected vs. actual behavior

License & Attribution

Ensure proper attribution when using course materials. Check repository for specific license terms.


Additional Resources

Recommended Books

  • "Automate the Boring Stuff with Python" - Al Sweigart
  • "Fluent Python" - Luciano Ramalho
  • "Effective Python" - Brett Slatkin

Online Communities

  • r/learnprogramming on Reddit
  • Python Discord servers
  • Stack Overflow Python tag
  • GitHub Discussions in repository

Practice Platforms

  • LeetCode (algorithm practice)
  • HackerRank (coding challenges)
  • Codewars (skill-building challenges)
  • Project Euler (mathematical problems)

Conclusion

The Python-3-Bootcamp provides a comprehensive pathway from beginner to intermediate-advanced Python proficiency. Through structured modules, hands-on projects, and best practices, learners develop both fundamental and professional programming skills. Success requires consistent practice, active engagement with exercises, and real-world project implementation.

Next Steps After Completion:

  1. Build personal projects
  2. Contribute to open-source
  3. Pursue specialized domains (data science, web dev, ML)
  4. Complete advanced certifications
  5. Join professional Python communities

Last Updated: December 2025
Course Duration: 12-16 weeks (self-paced)
Difficulty Level: Beginner to Intermediate
Prerequisites: None (computer literacy helpful)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages