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

Alan Gauld alan.gauld at btinternet.com
Wed Sep 25 21:11:44 CEST 2013


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.

> 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?

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...

> 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



More information about the Tutor mailing list