The best way to solidify your Python knowledge is by building practical projects. Here is a list of project ideas that range from beginner to intermediate levels to help you apply the concepts you’ve learned throughout this course.
1. Calculator App
Concepts used: Functions, if...else, user input, type casting.
Build a command-line calculator that asks the user for two numbers and an operation (add, subtract, multiply, divide). Use functions for each mathematical operation.
def add(x, y):
return x + y
# Add logic for subtract, multiply, divide
print("Select operation: 1.Add 2.Subtract 3.Multiply 4.Divide")
choice = input("Enter choice (1/2/3/4): ")
num1 = float(input("Enter first number: "))
num2 = float(input("Enter second number: "))
if choice == '1':
print(f"{num1} + {num2} = {add(num1, num2)}")
2. To-Do List CLI
Concepts used: Lists, loops, functions, file handling (for saving data).
Create a program that allows a user to:
- Add a task
- View all tasks
- Mark a task as completed
- Delete a task
- Save the tasks to a
tasks.txtfile so they persist after the program closes.
3. File Organizer Script
Concepts used: os module, shutil module, string manipulation.
Write a script that scans your “Downloads” folder. Based on the file extensions (e.g., .pdf, .jpg, .mp4), it should automatically create folders (like Documents, Images, Videos) and move the files into their respective folders.
4. Weather App with API
Concepts used: requests module, JSON parsing, dictionaries.
Use a free API like OpenWeatherMap. Ask the user for a city name, make a GET request to the API, and parse the JSON response to print out the current temperature, humidity, and weather description.
import requests
api_key = "YOUR_API_KEY"
city = input("Enter city name: ")
url = f"http://api.openweathermap.org/data/2.5/weather?q={city}&appid={api_key}&units=metric"
response = requests.get(url)
data = response.json()
print(f"Temperature in {city}: {data['main']['temp']}°C")
5. Web Scraper (BeautifulSoup)
Concepts used: requests, external libraries (bs4), HTML parsing, loops.
Install beautifulsoup4. Write a script that downloads a webpage (like a Wikipedia article or a news site), parses the HTML, and extracts all the headlines (e.g., all <h1> and <h2> tags) and prints them to the terminal.
6. Password Generator
Concepts used: random module, strings, loops.
Create a script that generates a highly secure, random password. Ask the user how many characters the password should be, and whether they want to include symbols and numbers. Use random.choice() on a pool of characters to build the string.
7. Quiz Game
Concepts used: Dictionaries, if...else, scoring logic.
Create a multiple-choice quiz. Store the questions, options, and correct answers in a list of dictionaries. Iterate through the questions, ask the user for their answer, evaluate it, and keep a running score. Print the final score at the end.
Discussion
Loading comments...