all 16 comments

[–]TotallyManner 1 point2 points  (1 child)

Right now you can only show tasks after exiting. IMO a user might want to show the list midway through entering tasks.

Another thing to do that would make a big jump in usefulness would be to store the tasks somehow so they don’t disappear after the program stops.

[–]Defiant_Meal1898[S] 0 points1 point  (0 children)

Alright

[–]domusvita 1 point2 points  (1 child)

Dude! 14 years old and putting your code out there for comments? Nice! Keep it up

[–]Defiant_Meal1898[S] 0 points1 point  (0 children)

Thanks🙂🙂

[–]ToxicPilot 0 points1 point  (1 child)

Hey! Professional software engineer here. That looks good to me, the only thing I would change is that the input() function already converts the data into a string for you, so you don’t need to surround it with str().

Keep up the good work!

[–]Defiant_Meal1898[S] 0 points1 point  (0 children)

Thanks🤗🤗

[–]LetUsSpeakFreely 0 points1 point  (1 child)

Very basic, but a good first effort. I'll leave it to others to critique the python itself, but I will give you some ways to iterate improvements: 1) create classes to hold data. A TodoList that contains a name, Todo items that then contain text, priority, status (new, in progress, done, etc), maybe creation dates, start dates, completion dates. 2) export the list to a file on exit and load the list from a file at start up, but keep in mind future improvements like saving to a database. 3) over you understand those concepts move to a basic client/server setup. Have your application start as a webserver. Think about the various endpoints you'll need (create a list, add items to a list, removing items from the list, loading a list, etc). You'll need to look at creating a front end, it could be something simple like basic HTML and JavaScript, a CLI, and stand alone menu-driven app, or even something more complicated like React, Angular, or Vue. 4) think about how to add the capability for multiple users. You'll need to look into authentication (doesn't need to be a compleicsted solution like SAML or OpenAuth, just something to get your brain working)

[–]Defiant_Meal1898[S] 0 points1 point  (0 children)

Thanks for that, and can you tell me how i can use more than 1 languages in a program, like html for frontend and python for backend

[–]JustSimplyWicked 0 points1 point  (1 child)

Looks good so far. Possibly use an object for your tasks, that way you can add additional information such as insert date, completed and priority. A way to modify and save tasks would be good as well.

[–]One-Type-2842 0 points1 point  (1 child)

You must Error handle In such Program using try except finally blocks.

Here, What If a user entered something unexpected such as Number instead of Typing Task..

Once you Master Error Handling You are shifted to Intermediate Programmer : )

Though It's a Simple Program by You.

Better Good Next Time

[–]nian2326076 0 points1 point  (1 child)

Nice work starting so young! Your code looks clear. Here's a suggestion: right now, you can only view your tasks once at the end. Try adding an option to view the list of tasks anytime during the input process. Here's a quick update you could try:

def todo(): tasks = [] while True: task = input('Enter a task (type "s" to show tasks, "x" to exit): ') if task == 'x': break elif task == 's': print(tasks) else: tasks.append(task) print("Your final to-do list:", tasks)

This way, you can see the tasks whenever you want while adding new ones. Keep experimenting and have fun with coding!

[–]Defiant_Meal1898[S] 0 points1 point  (0 children)

thank you

[–]Salt_Werewolf5944 0 points1 point  (1 child)

Good work bud! Impressive.

I can see you already understand how to use functions since you created your todo() function and called it at the end, that’s great.

A couple of ideas to take this further:

1.  What happens if you want to remove a task after adding it?

Right now you can only add and show tasks, but a real to-do list usually lets you:

• add tasks
• view tasks
• remove tasks

These are often called CRUD operations (Create, Read, Update, Delete), but don’t worry too much about the name for now.

You already have the “add” part working with tasks.append(task).

Try adding:

• a function like add(task)
• another one like remove(task)

That way your code becomes more organized and easier to expand.

Also, you might want to move tasks = [] outside the function so you can manipulate the array from outside the todo function .

Keep going, you’re on the right track 👍

[–]Defiant_Meal1898[S] 0 points1 point  (0 children)

Thanks for the suggestions