[Tutor] Writing program: To Do List in Python 3.0

Rafael Knuth rafael.knuth at gmail.com
Thu Sep 26 13:29:23 CEST 2013


Alan,

On Wed, Sep 25, 2013 at 9:11 PM, Alan Gauld <alan.gauld at btinternet.com> wrote:
> On 25/09/13 18:42, Rafael Knuth wrote:
>
>> I want to write a simple program (To Do List) that stores the input
>> data (action items on To Do List). Currently I can only input items
>> but the program I wrote doesn't store them.
>
>
> You need to write the data to a file or database when the program closes and
> then, when you start the program, read the data from
> that file or database.

Thank you for the clarification.
>
>
>> Here's the code I wrote so far:
>
>
> OK, This is very basic and can be improved in lots of ways so I'm guessing
> you are a new programmer and studying via some kind of
> course or tutorial?

Self study, yes. Intermediate beginner. I just started writing games
such as Hangman, Tic Tac Toe. Now I wanted to write a small To Do List
which requires reading and writing to files as you explained (which is
exactly what I want to learn now).
>
> At some stage it will cover reading and writing to files as well as data
> structures that will help store your data more effectively and looping
> constructs that will help you process it more effectively.
>
> You can read up on reading and writing to files if you want but
> it may be better not to run before you can walk...

Consider me a toddler. Can you advise how I should proceed in order to
improve my To Do List program based on the code I wrote so far
(insofar it's usable at all) ..? Weirdly, writing and reading to files
is not covered in those tutorials I am working with.

Thank you,

Rafael

>
>> print("This is my to do list")
>>
>> Monday = input("Monday ")
>> Tuesday = input("Tuesday ")
>> Wednesday = input("Wednesday ")
>> Thursday = input("Thursday ")
>> Friday = input("Friday ")
>> Saturday = input("Saturday ")
>> Sunday = input("Sunday ")
>>
>> print("So, here are your plans for:" +
>> "\nMonday " + Monday +
>> "\nTuesday " + Tuesday +
>> "\nWednesday " + Wednesday +
>> "\nThursday " + Thursday +
>> "\nFriday " + Friday +
>> "\nSaturday " + Saturday +
>> "\nSunday " + Sunday)
>
>
>
> --
> Alan G
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
> http://www.flickr.com/photos/alangauldphotos
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor


More information about the Tutor mailing list