0% found this document useful (0 votes)
8 views7 pages

Mini Project 1

The document outlines four mini projects aimed at enhancing student-centric learning through practical applications. These projects include a To-Do List application for task management, a Password Generator for creating strong passwords, a Quiz Application for automatic scoring of MCQs, and an Expense Tracker for managing and categorizing expenses. Each project is accompanied by a problem statement, algorithm, and Python code implementation.

Uploaded by

bshreer4
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views7 pages

Mini Project 1

The document outlines four mini projects aimed at enhancing student-centric learning through practical applications. These projects include a To-Do List application for task management, a Password Generator for creating strong passwords, a Quiz Application for automatic scoring of MCQs, and an Expense Tracker for managing and categorizing expenses. Each project is accompanied by a problem statement, algorithm, and Python code implementation.

Uploaded by

bshreer4
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Student-Centric Learning

Mini Project 1: To-Do List Application

Problem Statement

Many users forget daily tasks and struggle to organize their work.
This project aims to develop a To-Do List application that allows users to add, delete, and mark tasks
as completed using file storage.

Algorithm

1. Start the program

2. Display menu (Add, View, Complete, Delete, Exit)

3. Take user choice

4. If add → store task in file

5. If view → display all tasks

6. If complete → mark selected task as done

7. If delete → remove task

8. Repeat until exit

9. Stop

Python Code

# To-Do List Application

FILE = "[Link]"

def add_task():

task = input("Enter task: ")

with open(FILE, "a") as f:

[Link](task + "|Pending\n")

print("Task added")

def view_tasks():

try:

with open(FILE, "r") as f:

tasks = [Link]()

1
Student-Centric Learning

for i, t in enumerate(tasks, 1):

task, status = [Link]().split("|")

print(i, task, "-", status)

except FileNotFoundError:

print("No tasks found")

def complete_task():

with open(FILE, "r") as f:

tasks = [Link]()

num = int(input("Enter task number to complete: ")) - 1

task, status = tasks[num].strip().split("|")

tasks[num] = task + "|Done\n"

with open(FILE, "w") as f:

[Link](tasks)

print("Task completed")

def delete_task():

with open(FILE, "r") as f:

tasks = [Link]()

num = int(input("Enter task number to delete: ")) - 1

[Link](num)

with open(FILE, "w") as f:

[Link](tasks)

print("Task deleted")

while True:

print("\[Link] [Link] [Link] [Link] [Link]")

ch = input("Enter choice: ")

if ch == "1":

add_task()

2
Student-Centric Learning

elif ch == "2":

view_tasks()

elif ch == "3":

complete_task()

elif ch == "4":

delete_task()

elif ch == "5":

break

else:

print("Invalid choice")

3
Student-Centric Learning

Mini Project 2: Password Generator

Problem Statement

Weak passwords can lead to security risks.


This project develops a password generator that creates strong random passwords using uppercase
letters, lowercase letters, numbers, and symbols.

Algorithm

1. Start the program

2. Ask user for password length

3. Combine letters, digits, and symbols

4. Generate random characters

5. Display password

6. Stop

Python Code

# Password Generator

import random
import string

length = int(input("Enter password length: "))

characters = string.ascii_letters + [Link] + [Link]

password = ""
for i in range(length):
password += [Link](characters)

print("Generated Password:", password)

4
Student-Centric Learning

Mini Project 3: Quiz Application

Problem Statement

Traditional quizzes require manual evaluation.


This project aims to develop a Quiz Application that presents MCQ questions, calculates score
automatically, and displays results.

Algorithm

1. Start the program

2. Store questions and answers in dictionary

3. Display each question with options

4. Accept user answer

5. Check correctness and update score

6. After all questions, display final score

7. Stop

Python Code

# Quiz Application

questions = {
"Python is developed by?": "a",
"Which symbol used for comments in Python?": "b",
"Which keyword is used for function?": "c"
}

options = [
["a) Guido", "b) James", "c) Dennis"],
["a) //", "b) #", "c) /*"],
["a) defn", "b) function", "c) def"]
]

score = 0

for i, q in enumerate(questions):
print("\n", q)
for opt in options[i]:
print(opt)
ans = input("Enter answer: ")

if ans == questions[q]:
score += 1

print("\nFinal Score:", score)

5
Student-Centric Learning

Mini Project 4: Expense Tracker

Problem Statement

People often struggle to manage daily expenses and track spending patterns.
This project aims to develop an Expense Tracker that records expenses, categorizes them, and
calculates monthly totals using file storage.

Algorithm

1. Start the program

2. Display menu (Add, View, Monthly total, Exit)

3. If add → store expense with category and amount in file

4. If view → display all expenses

5. If monthly total → calculate total amount

6. Repeat until exit

7. Stop

Python Code

# Expense Tracker

FILE = "[Link]"

def add_expense():
category = input("Enter category: ")
amount = input("Enter amount: ")
with open(FILE, "a") as f:
[Link](category + "|" + amount + "\n")
print("Expense added")

def view_expense():
try:
with open(FILE, "r") as f:
for line in f:
cat, amt = [Link]().split("|")
print(cat, "-", amt)
except FileNotFoundError:
print("No expenses found")

def monthly_total():
total = 0
try:
with open(FILE, "r") as f:

6
Student-Centric Learning

for line in f:
cat, amt = [Link]().split("|")
total += float(amt)
print("Total expense:", total)
except FileNotFoundError:
print("No expenses found")

while True:
print("\[Link] [Link] [Link] [Link]")
ch = input("Enter choice: ")

if ch == "1":
add_expense()
elif ch == "2":
view_expense()
elif ch == "3":
monthly_total()
elif ch == "4":
break
else:
print("Invalid choice")

You might also like