[Tutor] Append a dictionary value

David david at abbottdavid.com
Sun Apr 5 01:58:38 CEST 2009


Sander Sweers wrote:

> I do not understand what it is you want to do. Do you want to replace
> the old date and time with the new? If so you already do this with
> todo[answer] = datevalue, time. Why do you want to use setdefault?

I was confused, I thought it would add another value to the key not 
change the current one.

> Why not use a datetime object?
> 
> todo = {'Study Python':
>     (datetime.datetime(2009, 4, 1,12,15)}
> 
> Greets
> Sander
> 
> 
thank you

-- 
Powered by Gentoo GNU/LINUX
http://www.linuxcrazy.com
pgp.mit.edu



More information about the Tutor mailing list