Mini Project
Mini Project
PR E S E N T E D B Y
V.S A RVAN I R E D D Y
S .C H A N D IN I D E V I
R .P R A S U N A C H A N D R IK A
Y.S R AV YA
Introduction
3.Browser
Functionality
1. print_menu():
Displays menu options for user interaction, ensuring clear navigation.
Essential for guiding users through the application and facilitating
seamless interaction.
2. add_task(tasks):
Enables users to add new tasks with details like description and due date.
Ensures all commitments are recorded and managed efficiently within
the task list.
3. view_tasks(tasks):
Provides users with a comprehensive view of all tasks in the list.
Facilitates effective planning and prioritization by presenting pending tasks clearly.
4. mark_completed(tasks):
Allows users to track progress by marking tasks as completed.
Helps you stay organized and reach your goals by showing what you've done.
5. delete_task(tasks):
Makes it so you can take away tasks you don't need anymore.
Helps you manage tasks better so you can concentrate on what's important.
6.main():
Runs the whole app
Makes sure everything works smoothly.
Project Code:
def print_menu():
print("\nMenu:")
print("1. Add task")
print("2. View tasks")
print("3. Mark task as completed")
print("4. Delete task")
print("5. Exit")
def add_task(tasks):
task = input("Enter the task: ")
tasks.append({"task": task, "completed": False})
print("Task added successfully!")
def view_tasks(tasks):
print("\nTasks:")
for index, task in enumerate(tasks, start=1):
status = "Completed" if task["completed"] else "Pending"
print(f"{index}. {task['task']} - {status}")
def mark_completed(tasks):
index = int(input("Enter the index of the task to mark as completed: ")) - 1
if 0 <= index < len(tasks):
tasks[index]["completed"] = True
print("Task marked as completed!")
else:
print("Invalid index.")
def delete_task(tasks):
index = int(input("Enter the index of the task to delete: ")) - 1
if 0 <= index < len(tasks):
del tasks[index]
print("Task deleted successfully!")
else:
print("Invalid index.")
def main():
tasks = []
while True:
print_menu()
choice = input("Enter your choice: ")
if choice == "1":
add_task(tasks)
elif choice == "2":
view_tasks(tasks)
elif choice == "3":
mark_completed(tasks)
elif choice == "4":
delete_task(tasks)
elif choice == "5":
print("Exiting...")
break
else:
print("Invalid choice. Please try again.")
if __name__ == "__main__":
main()
Outputs:
Adding Tasks
Viewing
the Tasks
Marking
the task as
completed
Deleting
a task
Exiting
Conclusion: