Featured
- Get link
- X
- Other Apps
Python Code for " To-Do List ". Computer Science project for BEGINNER
HERE'S A SIMPLE PYTHON CODE FOR A To-Do LIST USING COMMAND LINE INTERFACE:
SOURCE CODE-
tasks = []
while True:
print("Enter a task for your to-do list (press 'q' to quit): ")
task = input()
if task == 'q':
break
tasks.append(task)
print(f'Task "{task}" added to your to-do list.')
print("\nHere's your to-do list:")
for task in tasks:
print(task)
DESCRIPTION:
This code creates an empty list called tasks and then starts a loop that repeatedly asks the user to input a task for their to-do list. If the user types 'q', the loop breaks and the program ends. If the user enters a task, the program adds it to the tasks list and prints a message confirming that the task was added. Finally, the program prints the list of tasks entered by the user.
- Get link
- X
- Other Apps
Popular Posts
Python code for " Simple Calculator " . Computer science project
- Get link
- X
- Other Apps

Comments
Post a Comment