- Intro to Python & Control Flow
- Loops & Logic
- Functions & Lists
- Dictionaries & Sets
- Object-Oriented Programming (OOP)
- Regular Expressions (Regex)
- Functional Programming
- APIs & HTTP Requests
- SQL & Database Design
- Flask & ORM (Intermediate/Advanced)
- File I/O & Configuration
- Decorators & Context Managers
- AsyncIO & Generators
- Frontend Development (HTML/CSS)
- JavaScript Fundamentals
- Web Interactivity & Frameworks
Solution: Python_Basics/Control_Flow_Solutions.py
- Goal: Write a script that asks for a user's name and age, then prints a greeting message like:
"Hello, [Name]! You are [Age] years old!"
- Goal: Calculate the year a person will turn 100.
- Logic:
century_year = current_year + (100 - current_age)
- Goal: Write an if-else statement.
- Prompt: Ask for user input (e.g., "Is it raining?"). If yes, print "Take an umbrella". If no, print "Enjoy the sun".
- Goal: Check voting eligibility.
- Logic: If
age >= 18, print "Can vote". Else, print "Cannot vote".
- Goal: Convert numerical scores to letter grades.
- Logic:
- 90-100: A
- 80-89: B
- 70-79: C
- 60-69: D
- < 60: F
- Goal: Write a program that asks for an integer (age).
- Requirement: Use
try/exceptto handle cases where the user types text instead of a number.
Solution: Python_Basics/Control_Flow_Solutions.py
- Goal: Create a loop that counts from 1 to 5 and prints each number.
- Goal: Create a loop that counts down from 5 to 1, then prints "Blast Off!".
- Goal: Create a
whileloop that repeatedly asks the user for a password until they type "secret".
- Goal: Create a script that accepts temperature readings from the user until they type 'done'.
- Output: Print the count of readings, the total, the average, the minimum, and the maximum.
Solution: Data_Structures/Lists_Dicts_Solutions.py
- Define:
greet(name)-> prints "Hello [name]" - Define:
rectangle_area(length, width)-> returns area. - Define:
add(num1, num2)-> returns sum.
- Define:
celcius_to_farenheit(celcius)-> returns converted temp.
- Goal: Write a function
list_statistics(numbers)that takes a list of numbers and returns a dictionary containing:max: Maximum valuemin: Minimum valueavg: Average valuesum: Sum of values
- Create a list of fruits.
- Add "strawberry" to the end.
- Remove "orange" by value.
- Remove the item at index 1.
- Check if "apple" is in the list.
Solution: Data_Structures/Lists_Dicts_Solutions.py
- Data: A dictionary of student names and scores.
- Subtasks:
- Loop through and print all names.
- Loop through and print all scores.
- Print "Name: Score" pairs.
- Use
.get()to safely check for a missing student.
- Structure: Nested dictionary (Categories -> Items -> Details).
- Subtasks:
- Access and print specific item prices.
- Update stock levels.
- Add new items and categories.
- Calculate the total value of inventory.
- Goal: Write a function
clean_usernames(raw_list)that takes a list of strings (some with whitespace/casing issues) and returns a clean list (lowercase, stripped).
- Scenario: You have two lists of hobbies (e.g.,
wilson_hobbiesandfriend_hobbies). - Subtasks:
- Find common interests (Intersection).
- Find all unique hobbies combined (Union).
- Find hobbies unique to one person (Difference).
Solution: OOP/OOP_Solutions.py
- Attributes:
name,age,grades(list). - Methods:
add_grade(grade)grade_avg(): Returns average.info(): Prints student details.
- Attributes:
username(public),_password(protected/private). - Methods:
set_password(new_pass): Validates length/characters before setting.get_password(): Returns the password (or a masked version).
- Base Class:
Character(name, health, attack_power). - Subclasses:
Warrior(High health, standard attack).Mage(Lower health, high attack,special_attackmethod).EvilWizard(Boss character,regeneratemethod).
- Goal: Simulate a battle loop where characters attack each other until one falls.
Solution: Regex/Regex_Solutions.py
- Find the first word in a text (
\w). - Find a phone number (
\d{3}-\d{4}). - Find all 5-digit IDs (
\d{5}).
- Input: Raw customer feedback with varying spacing and sensitive data.
- Subtasks:
- Remove phone numbers (Replace with "[REDACTED]").
- Fix multiple spaces (Replace
\s+with" ").
Solution: Functional/Functional_Solutions.py
- Input: List of product dictionaries (
{'name': 'A', 'price': 10}). - Goal: Sort by price (descending) using
sorted()and alambdakey.
- Input: List of employee dictionaries.
- Goal: Use
map()to create a new list where every employee gets a 7% raise.
- Input: List of books (
{'title': 'A', 'rating': 4.5}). - Goal: Use
filter()to find books with a rating >= 4.0.
- Goal: Write a one-liner that takes a list of numbers, keeps only the evens, and doubles them.
Solution: APIs/API_Solutions.py
- Goal: Use
requeststo fetch a random dog image fromhttps://dog.ceo/api/breeds/image/randomand print the URL.
- Goal: Write a function
get_pokemon_data(name)that:- Fetches data from
https://pokeapi.co/api/v2/pokemon/{name}. - Parses JSON to extract Name, ID, HP, and Type.
- Returns a dictionary (or
Noneon error).
- Fetches data from
- Goal: Implement the Client Credentials Flow to get a Spotify Access Token.
- Steps:
- Base64 encode
client_id:client_secret. - POST to
https://accounts.spotify.com/api/token. - Extract
access_tokenfrom the response.
- Base64 encode
Solution: SQL/SQL_Solutions.sql
- Write SQL to create a
Studentstable (id, name, email) and aCoursestable (id, title, instructor).
- Write SQL to select all students named "Alice".
- Write SQL to update a course title.
- Write SQL to delete a specific record.
Solution:
- Context: Mechanics, Customers, Tickets.
- Subtasks:
- Customer Search: Endpoint to find customer by email (
GET /search?email=...). - Analytics: Endpoint to find the mechanic with the most completed tickets.
- Pagination: Paginate the
GET /ticketsendpoint.
- Customer Search: Endpoint to find customer by email (
- Goal: Implement "Item Definition" vs "Item Instance" pattern.
- Endpoints:
POST /catalog: Create a generic book title.POST /catalog/{id}/add: Add a physical copy of that book.
- Goal: Implement a checkout flow.
- Flow: Create Order (Pending) -> Add Items -> Checkout (Complete).
- Goal: Create a CLI or API function to schedule an appointment.
- Logic: Select Pet -> Select Vet -> Choose Date -> Commit to DB.
Solution: Python_Basics/File_Ops_Solutions.py
- Goal: Create a script that reads a "server.log" file line-by-line.
- Action: Count how many lines contain "ERROR".
- Output: Write a summary report to "log_report.txt".
- Goal: Write a function to manage application configuration.
- Subtasks:
- Load
config.json(use defaults if missing). - Update a specific setting (e.g.,
theme: "dark"). - Save the changes back to the file.
- Load
Solution: Advanced_Python/Decorators_Context_Solutions.py
- Goal: Create a
@timerdecorator. - Behavior: When wrapping a function, it should print "Function [name] took [x] seconds" after execution.
- Goal: Create a class
FileManagerthat behaves like the built-inopen(). - Requirement: It must print "Opening file..." when entering the
withblock and "Closing file..." when exiting.
Solution: Advanced_Python/Async_Generators_Solutions.py
- Goal: Write a generator function
fib(limit)that yields Fibonacci numbers one by one up to a specified count, rather than returning a list.
- Goal: Create an async function
fetch_data(id)that waits for a random delay. - Action: Use
asyncio.gatherto run three fetches concurrently and print the results when all are done.
Solution: HTML_Profile_Solution.html, CSS_Card_Component_Solution.html, Flexbox_Navbar_Solution.html, Grid_Gallery_Solution.html
Resources: HTML Cheat Sheet, CSS Cheat Sheet, CSS Layout Guide
- Goal: Create a simple "About Me" page (
index.html). - Requirements:
- Use semantic tags:
<header>,<main>,<section>,<footer>. - Include a profile image (
<img>), a bio paragraph (<p>), and a list of hobbies (<ul>).
- Use semantic tags:
- Goal: Style a
<div>to look like a UI card. - CSS Requirements:
- Add
padding,border, and a slightbox-shadow. - Ensure the image inside fits the card width (
max-width: 100%).
- Add
- Goal: Create a navigation bar.
- Structure: A container with a logo on the left and links on the right.
- CSS: Use
display: flexandjustify-content: space-between.
- Goal: Create a responsive photo gallery.
- CSS: Use
display: grid,grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)), andgap.
Solution: JavaScript_Basics_and_Functions_Solutions.js, JavaScript_Array_Manipulation_Solutions.js, JavaScript_Object_Access_Solutions.js
Resources: JS Basics Cheat Sheet, JS Functions Guide
- Goal: Create a script (
script.js) that logs "Hello, World!" to the console. - Subtasks:
- Declare a variable
nameusingletand assign it your name. - Use a template literal to log "Hello, [name]!".
- Run it using
node script.js(if Node is installed) or attach it to an HTML file.
- Declare a variable
- Goal: Write a function
calculate(num1, num2, operation). - Logic:
- If operation is "+", return sum.
- If "-", return difference.
- Use a
switchstatement. - Bonus: Convert it to an arrow function.
- Goal: Practice array methods.
- Data:
let numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; - Subtasks:
- Filter out odd numbers (keep only evens).
- Map the remaining numbers to their squares.
- Log the final array.
- Goal: Working with Objects.
- Data:
const car = { make: "Toyota", model: "Corolla", year: 2020, features: ["AC", "Radio", "Bluetooth"] };
- Action:
- Log the
makeandmodelcombined. - Loop through
featuresand log each one. - Add a new property
mileagewith value 50000.
- Log the
Resources: Bootstrap Cheat Sheet, DOM Manipulation Guide, CSS Cheat Sheet
- Goal: Create a responsive landing page using Bootstrap.
- Requirements:
- Include the Bootstrap CDN in your
<head>. - Create a
navbar. - Create a hero section with a centered
h1andbutton. - Create a 3-column feature section using
.rowand.col-md-4.
- Include the Bootstrap CDN in your
- Goal: Build an interactive color switcher.
- UI: A set of
divs with different colors and a large "Canvas"div. - Logic:
- Select all color swatches using
document.querySelectorAll. - Loop through them and add a
clickevent listener. - When clicked, change the background color of the "Canvas" to match the clicked swatch.
- Select all color swatches using
- Goal: Persist user data across page reloads.
- UI: A form with "Username" and "Theme Preference" (Light/Dark).
- Logic:
- Listen for the
submitevent. - Save the values to
localStorage(e.g.,localStorage.setItem('user', ...)). - On page load (
DOMContentLoaded), checklocalStorage. If data exists, pre-fill the form.
- Listen for the
- Goal: Style a button with a "shine" effect or an underline animation.
- CSS:
- Use
::beforeor::afterto create a decorative element. - Use
:hoverto trigger atransformortransition. - Try styling
::first-letterof a paragraph to look like a drop cap.
- Use