Python Mini Project Ideas with Sample Code
1. To-Do List (Console App)
A simple task manager app in the terminal.
tasks = []
while True:
task = input('Enter a task (or type exit): ')
if task == 'exit': break
[Link](task)
print('Your tasks:', tasks)
2. Weather App (using API)
Fetch weather data using OpenWeatherMap API.
import requests
city = 'London'
api_key = 'your_api_key'
url = f'[Link]
data = [Link](url).json()
print(data['weather'][0]['description'])
3. File Organizer
Automatically organize files in a folder by type.
import os, shutil
files = [Link]('.')
for file in files:
if [Link]('.txt'):
[Link](file, 'TextFiles/' + file)
4. Currency Converter (API)
Converts currency using an exchange rate API.
import requests
url = '[Link]
data = [Link](url).json()
amount = 100
print('INR:', amount * data['rates']['INR'])
5. URL Shortener
Shorten a long URL using tinyurl API.
import requests
url = '[Link]
short_url = [Link](url).text
print('Short URL:', short_url)