Top 10 Python Projects for Beginners (With Source Code)
Are you just starting out with Python and wondering what projects to build? Working on hands-on projects is one of the most effective ways to solidify your programming skills. In this tutorial, we shall explore 10 beginner-friendly Python projects, each with a diagram and source code to get you coding right away!
You can look for 100 python projects description with source code on projects page
Working on projects is the fastest way to move from theory to practice in Python. These 10 beginner-friendly projects cover essential programming concepts like loops, conditionals, functions, and APIs, so you gain hands-on experience while having fun. Each project includes a diagram and ready-to-run source code to accelerate your learning.
📌 Jump to Project:
💡 Tips for Beginners
- Try to understand the logic before copying the code.
- Run the code in Python Interactive Mode for quick testing.
- Modify the code to see what changes occur, experimentation is key!
- Document your projects in separate files for future reference.
✅ 1. Number Guessing Game
💡 Concept Diagram:
[Start] → [Generate Random Number] → [User Guesses] →
[Check Guess] → [Too High/Low?] → [Try Again] →
[Correct?] → [End]
What You will Learn:
- Loops
- Conditional statements
- Random module
🧾 Source Code:
import random
number = random.randint(1, 100)
guess = None
while guess != number:
guess = int(input("Guess a number between 1 and 100: "))
if guess < number:
print("Too low!")
elif guess > number:
print("Too high!")
else:
print("Congratulations! You guessed it.")
✅ 2. Simple Calculator
💡 Concept Diagram:
[Input Num1] + [Input Operator] + [Input Num2] →
[Perform Operation] → [Display Result]
What You'll Learn:
- Functions
- Basic arithmetic
- Input handling
🧾 Source Code:
def calculator():
num1 = float(input("Enter first number: "))
operator = input("Enter operator (+, -, *, /): ")
num2 = float(input("Enter second number: "))
if operator == '+':
print(num1 + num2)
elif operator == '-':
print(num1 - num2)
elif operator == '*':
print(num1 * num2)
elif operator == '/':
print(num1 / num2)
else:
print("Invalid operator")
calculator()
✅ 3. To-Do List (Console-Based)
💡 Concept Diagram:
[Menu] → [Add Task / View Tasks / Delete Task] →
[List Updated]
What You will Learn:
- Lists
- Menu-driven programs
🧾 Source Code:
tasks = []
def show_menu():
print("\n1. Add Task\n2. View Tasks\n3. Delete Task\n4. Exit")
while True:
show_menu()
choice = input("Enter choice: ")
if choice == '1':
task = input("Enter task: ")
tasks.append(task)
elif choice == '2':
for i, task in enumerate(tasks):
print(f"{i+1}. {task}")
elif choice == '3':
index = int(input("Enter task number to delete: ")) - 1
if 0 <= index < len(tasks):
tasks.pop(index)
else:
print("Invalid task number.")
elif choice == '4':
break
else:
print("Invalid choice.")
✅ 4. Dice Roller Simulator
💡 Concept Diagram:
[Press Enter] → [Generate Random Number (1-6)] → [Display Dice Face]
What You'll Learn:
- Random numbers
- Loop control
🧾 Source Code:
import random
while input("Roll the dice? (y/n): ").lower() == 'y':
print(f"You rolled a {random.randint(1, 6)}")
✅ 5. Countdown Timer
💡 Concept Diagram:
[Input Time] → [Countdown Loop] → [Time's Up]
What You will Learn:
- Time module
- Loops
🧾 Source Code:
import time
t = int(input("Enter time in seconds: "))
while t:
mins, secs = divmod(t, 60)
print(f'{mins:02d}:{secs:02d}', end='\r')
time.sleep(1)
t -= 1
print("Time's up!")
✅ 6. Basic Contact Book
💡 Concept Diagram:
[Menu] → [Add/View/Delete Contact] → [Dictionary Update]
What You will Learn:
- Dictionaries
- Functions
- File handling (Optional)
🧾 Source Code:
contacts = {}
def add_contact():
name = input("Name: ")
phone = input("Phone: ")
contacts[name] = phone
def view_contacts():
for name, phone in contacts.items():
print(f"{name}: {phone}")
while True:
print("\n1. Add\n2. View\n3. Exit")
choice = input("Choice: ")
if choice == '1':
add_contact()
elif choice == '2':
view_contacts()
elif choice == '3':
break
✅ 7. Password Generator
💡 Concept Diagram:
[Input Length] → [Randomly Select Characters] → [Display Password]
What You will Learn:
randomandstringmodules- String manipulation
🧾 Source Code:
import random
import string
length = int(input("Enter password length: "))
chars = string.ascii_letters + string.digits + string.punctuation
password = ''.join(random.choice(chars) for _ in range(length))
print("Generated password:", password)
✅ 8. QR Code Generator
💡 Concept Diagram:
[Input Text/URL] → [Generate QR Image] → [Save File]
What You will Learn:
- External libraries (
qrcode)
🧾 Source Code:
pip install qrcode
import qrcode
data = input("Enter data to encode: ")
img = qrcode.make(data)
img.save("qrcode.png")
print("QR code saved as qrcode.png")
✅ 9. Weather App (Using API)
💡 Concept Diagram:
[Input City] → [Fetch from OpenWeatherMap API] → [Display Weather]
What You will Learn:
- APIs
- JSON parsing
requestsmodule
🧾 Source Code:
pip install requests
import requests
API_KEY = "your_api_key_here"
city = input("Enter city: ")
url = f"http://api.openweathermap.org/data/2.5/weather?q={city}&appid={API_KEY}&units=metric"
response = requests.get(url)
data = response.json()
if data.get('main'):
print(f"Temperature: {data['main']['temp']}°C")
else:
print("City not found.")
✅ 10. Tic-Tac-Toe (2 Player Game)
💡 Concept Diagram:
[Player 1 & 2 Turn] → [Update Board] → [Check Winner/Draw] → [Repeat]
What You will Learn:
- Lists
- Game logic
- Conditions
🧾 Source Code:
def print_board(board):
for row in board:
print(" | ".join(row))
print("-" * 5)
def check_winner(board):
for row in board:
if row.count(row[0]) == 3 and row[0] != ' ':
return row[0]
for col in range(3):
if board[0][col] == board[1][col] == board[2][col] != ' ':
return board[0][col]
if board[0][0] == board[1][1] == board[2][2] != ' ':
return board[0][0]
if board[0][2] == board[1][1] == board[2][0] != ' ':
return board[0][2]
return None
board = [[" "]*3 for _ in range(3)]
turn = "X"
for _ in range(9):
print_board(board)
row = int(input(f"{turn}'s turn. Enter row (0-2): "))
col = int(input(f"{turn}'s turn. Enter col (0-2): "))
if board[row][col] == " ":
board[row][col] = turn
winner = check_winner(board)
if winner:
print_board(board)
print(f"{winner} wins!")
break
turn = "O" if turn == "X" else "X"
else:
print("Cell already taken.")
else:
print("It's a draw!")
🏆 Best Practices While Building Python Projects
- Write clean and readable code, follow PEP 8 guidelines.
- Test small parts of your project before combining them.
- Use comments to explain complex parts of your code.
- Save versions regularly and organize your files.
- Experiment with adding extra features to enhance your projects.
🔗 Related Python Tutorials
Check out these tutorials to complement your project learning:
- Python Basic Syntax Explained
- Python Interactive Mode
- Python Script Mode Explained
- Python Functions and Modules
- Complete List of 100 Python Projects
❓ Frequently Asked Questions
1. Are these projects suitable for complete beginners?
Yes, all projects are beginner-friendly and teach fundamental Python concepts while being fun to build.
2. Do I need to install any libraries?
Most projects use standard Python modules. Some, like the QR code generator or weather app, require installing external libraries such as qrcode or requests.
3. Can I modify these projects?
Absolutely! Modifying code helps you learn faster and encourages creative problem-solving.
4. Will these projects help me with interviews?
Yes. Completing these projects strengthens your programming skills and builds a portfolio to showcase to potential employers.
🔚 Final Thoughts
- Each of these projects helps you practice essential Python concepts while having fun. Start with one, tweak it, break it, fix it and watch your Python skills grow!
- These Python projects are perfect for beginners to practice essential concepts like loops, functions, lists, dictionaries, APIs, and more. Completing these projects gives you confidence and hands-on experience, preparing you for larger Python applications and real-world problem-solving.
- Start small, experiment, and gradually move to bigger projects. Remember: consistent practice is the key to becoming proficient in Python.
Click Next: to explore the list of 100 python projects with source code for beginners, intermediate and Expert level!