Top 10 Python Projects for Beginners (With Links and Source Code)

← Back to Home

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 prjects description with source code on projects page


✅ 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:

  • random and string modules
  • 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
  • requests module

🧾 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!")

🔚 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!

Click Next:  to explore the list of 100 python projects with source code for beginners, intermediate and Expert level!