[Tutor] Creating To Do List Program - Question

Dave Angel davea at davea.name
Mon Sep 30 14:30:07 CEST 2013


On 30/9/2013 07:47, Rafael Knuth wrote:

> Dominik,
>
> this was my original question:
>
> As of now, I want to understand how I can add
> further functionalities to my program such as: appending items to the
> list, removing and replacing items. Can anyone help?
>
> Simple as that.
>

Your original program had some code that interacted with the user.  So
when you went from that to a giant print statement, I, and proably many
others, thought you were just kidding.

Are you using Python 3.3, under Windows?

So let me ask some questions about your level of understanding.

Do you know what an if statement is?  How about a for or while
statement?

Can you write code in a function, have it take parameters and return
results?  Do you know how to call such a function?

Do you know what a list is?  Can you manipulate it at all?  Can you
create it from a literal, using the [] syntax.

Do you know what a file is?  Do you know the difference between text
file and binary file?  Can you read a text file into a list?  Can you
write a list of strings out to a text file?

If you understand all these pieces, you're probably ready to try to
construct a todo list program.  If not, I second the suggestion to
follow a tutorial, till it's covered at least all of these.

(I may have missed quite a few items, but I think all of these are
necessary.)


For example, write a function that builds a list of strings by asking
the user, a line at a time, till the user enters a blank string.  The
function should return the list.

Once you think you have the function written, write a simple top-level
program that calls the function and prints the results.  Then have it
print the results one line at a time.

-- 
DaveA




More information about the Tutor mailing list