0% found this document useful (0 votes)
454 views8 pages

Computer Project 2024-25

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)
454 views8 pages

Computer Project 2024-25

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
You are on page 1/ 8

ON

“To-Do List Organizer”

SESSION: 2024-25

UNDER

CENTRAL BOARD OF SECONDARY EDUCATION


GURU NANAK PUBIC SCHOOL, SAMBALPUR

Mr. Suvendu Khamari Udayan Debnath


Dept. of Computer Class: XII Science B
Roll No:
ACKNOWLEDGEMENT

I want to express my deep sense of gratitude towards our


teacher Mr. Suvendu Khamari, GNPS, SBP.

Without his guidance and judicious suggestion it would not


have been possible on my part to complete this project on
time.

I am also thankful to my parents and my friends for their kind


support and help from time to time to complete this project
work.
CERTIFICATE

This is to certify that this piece of work "To-Do List Organizer"


has been submitted by Udayan Debnath for the partial
fulfilment of computer science examination for AISSCE-2024-
25 for class XII Science under my supervision and guidance in
Guru Nanak Public School, Sambalpur during the academic
year 2024-2025.

Signature of Internal Signature of External Signature of Principal


Declaration

I Udayan Debnath a student of STD-XII (Science) of Guru


Nanak Public School, Sambalpur. Hereby declare that this
project work is executed by me under the guidance of our
faculty of computer department and is completed to the best
of my knowledge and belief.

Udayan Debnath
GNPS, Sambalpur
Roll No:
Python Project: To-Do List Organizer

Code:
# Todo List Organizer in Python
# This program allows users to add, view, and remove tasks from a to-do list.

# Initializing an empty list to store tasks


todo_list = []

# Function to display menu options


def display_menu():
print("\nTodo List Organizer")
print("1. View Todo List")
print("2. Add a Task")
print("3. Remove a Task")
print("4. Exit\n")

# Function to view all tasks


def view_tasks():
if len(todo_list) == 0:
print("Your todo list is empty.")
else:
print("\nHere are your tasks:")
for i, task in enumerate(todo_list, 1):
print(f"{i}. {task}")

# Function to add a new task


def add_task():
task = input("Enter a new task: ")
todo_list.append(task)
print(f"Task '{task}' added to the list!")

# Function to remove a task by its number


def remove_task():
try:
task_number = int(input("Enter the task number to remove: "))
if 1 <= task_number <= len(todo_list):
removed_task = todo_list.pop(task_number - 1)
print(f"Task '{removed_task}' removed from the list!")
else:
print("Invalid task number.")
except ValueError:
print("Please enter a valid number.")

# Main loop to interact with the user


def main():
while True:
display_menu()
choice = input("Choose an option: ")

if choice == '1':
view_tasks()
elif choice == '2':
add_task()
elif choice == '3':
remove_task()
elif choice == '4':
print("Exiting Todo List Organizer. Goodbye!")
break
else:
print("Invalid choice. Please try again.")

# Starting the program


if __name__ == "__main__":
main()
Documentation:

1. Introduction:

This project is a Python-based Todo List Organizer that allows users to


manage their tasks efficiently. The user can perform three main actions: view
tasks, add tasks, and remove tasks. The program uses basic control
structures, functions, and list handling in Python.

2. Code Explanation:

- The program starts by defining an empty list called `todo_list`, where tasks
are stored.
- A menu is displayed using the `display_menu()` function to allow the user to
choose actions.
- The user can view the tasks with the `view_tasks()` function, which lists the
tasks or informs the user if the list is empty.
- The `add_task()` function prompts the user to input a new task, which is
then appended to the `todo_list`.
- To remove a task, the `remove_task()` function takes a task number as input,
checks its validity, and removes the corresponding task from the list.
- The program runs in an infinite loop, allowing continuous user interaction
until the user chooses to exit by selecting option `4`.

3. Functions:

- `display_menu()`: Displays the main menu options.


- `view_tasks()`: Displays the list of tasks or informs the user if no tasks are
available.
- `add_task()`: Adds a task to the to-do list.
- `remove_task()`: Removes a task based on the task number provided by the
user.
- `main()`: The main loop that controls the flow of the program based on user
input.
Output:

You might also like