Skip to content

flyingmermaidd/core-python-exercises

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Python Problem Set: Foundational Programming Exercises

This repository contains solutions to a collection of beginner-to-intermediate Python programming exercises. The problems cover a wide range of topics, including functions, recursion, object-oriented programming, file I/O, HTML parsing, web scraping, SQL, and list comprehensions. This notebook serves as a comprehensive practice resource for learners who want to build a strong foundation in Python programming and basic data handling.

Repository Contents

  • problemset2.ipynb
    A Jupyter notebook with code-based solutions to several programming questions. Key topics include:

    • Function definitions and use of global variables
    • Reading files with error handling
    • Class creation and inheritance
    • The Collatz sequence and recursion
    • Parsing HTML using HTMLParser
    • Basic web scraping using BeautifulSoup and urllib
    • SQL query writing for typical data extraction tasks
    • List comprehensions and data transformation
  • bloodtype1.txt
    A sample text file used in Question 2 to demonstrate file handling and exception management.

  • w3c.html
    A static HTML file used in Question 6 for parsing headings with a custom parser.

Prerequisites

Ensure you have Python 3.x and the following libraries installed:

  • beautifulsoup4
  • urllib (part of Python’s standard library)
  • html.parser (built-in)

To install required packages, run:

pip install beautifulsoup4

How to Use

  1. Clone the repository:
git clone https://github.com/your-username/your-repo-name.git
cd your-repo-name
  1. Open the notebook using Jupyter:
jupyter notebook problemset2.ipynb
  1. Run and explore each section of the notebook to deepen your understanding of core Python programming concepts.

Notes

  • SQL queries assume a table named weather with columns such as City, Country, Season, Temperature, and Rainfall.
  • Ensure internet access is available when running web scraping code that fetches content from live websites.
  • All examples are written in Python 3.

Learning Objectives

By working through the notebook, you will:

  • Strengthen your Python coding fundamentals
  • Understand how to structure and inherit classes
  • Learn to parse and analyze text and HTML content
  • Apply recursion and file handling techniques
  • Practice real-world data querying with SQL
  • Gain confidence using Python's list comprehensions for efficient coding

Acknowledgments

Gratitude to all the online learning platforms and mentors who inspire continuous learning. This work builds on foundational exercises and projects typically found in Python programming courses and tutorials.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published