roberrtt
New Coder
Hello there,
I am new to Python and coding in general, and I’m working on a small project to practice what I have learned so far. My goal is to create a simple command line to-do list app that can perform basic tasks like adding; removing; and viewing tasks.
Users can input a task, and it will be added to the list. Display all current tasks with numbers assigned to each for easy reference.
Users can enter the task number to remove it from the list. Maybe display completed tasks separately?
I have written some basic code that can take input and store tasks in a list; but I am struggling with organizing the functions properly. For example, how do I keep the program running until the user decides to exit? Also; how should I structure the code to make it clean and easy to maintain?
Also, I have gone through this post; Read Me - How to post your code into threads which definitely helped me out a lot.
Thanks in advance for help and assistance.
I am new to Python and coding in general, and I’m working on a small project to practice what I have learned so far. My goal is to create a simple command line to-do list app that can perform basic tasks like adding; removing; and viewing tasks.
Users can input a task, and it will be added to the list. Display all current tasks with numbers assigned to each for easy reference.
Users can enter the task number to remove it from the list. Maybe display completed tasks separately?
I have written some basic code that can take input and store tasks in a list; but I am struggling with organizing the functions properly. For example, how do I keep the program running until the user decides to exit? Also; how should I structure the code to make it clean and easy to maintain?
Also, I have gone through this post; Read Me - How to post your code into threads which definitely helped me out a lot.
Python:
tasks = []
def add_task(task):
tasks.append(task)
print(f"'{task}' added to the list.")
def view_tasks():
for idx, task in enumerate(tasks, 1):
print(f"{idx}. {task}")
# Incomplete: remove_task and main program loop
Thanks in advance for help and assistance.
Last edited by a moderator: