[Tutor] Creating To Do List Program - Question
Rafael Knuth
rafael.knuth at gmail.com
Mon Sep 30 15:00:08 CEST 2013
Hej Dave,
thank you for your response.
> 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.
I noticed that, but I was serious about that. I mean, my giant print
statement was really ridiculous to say the least but it did what I
wanted the program to do - adding items to the To Do List and printing
that list. However, I knew this was my very first iteration and I
wanted to improve my program by making those incremental baby steps.
> Are you using Python 3.3, under Windows?
Python 3.0 under Windows.
> So let me ask some questions about your level of understanding.
Sure.
> Do you know what an if statement is? How about a for or while
> statement?
Yes, I am familiar with both.
> Can you write code in a function, have it take parameters and return
> results? Do you know how to call such a function?
Yes.
> Do you know what a list is? Can you manipulate it at all? Can you
> create it from a literal, using the [] syntax.
Yes.
> 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?
I worked with text files yet, I have to admit I haven't worked with
binary files though - and I don't know yet what they are. But I will
figure that out.
> 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.
Ok, cool.
> (I may have missed quite a few items, but I think all of these are
> necessary.)
Ok, so I will rewrite that To Do list as you (and the others)
suggested and I will get back to you in case I have any further
questons.
> 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.
Ok, understood.
> 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.
I don't understand yet what a top-level program is, but I will figure that out.
Again, thank you all.
I have a fairly good understanding of how I should proceed now.
Rafael
More information about the Tutor
mailing list