[Tutor] Adding key, value to Dictionary
David
david at abbottdavid.com
Fri Mar 27 19:05:42 CET 2009
greg whittier wrote:
> On Fri, Mar 27, 2009 at 1:31 PM, David <david at abbottdavid.com> wrote:
>> But I can not get this to update after the first time it is ran.
>>
>> def get_todo():
>> todo = {}
moved todo{} outside of the function
>
> This set todo to an empty dictionary each time you execute get_todo.
Ok I see it now.
>
> todo = {key:value} again resets the value of todo. You only need
> todo[key]=value.
Yep, thanks
--
Powered by Gentoo GNU/LINUX
http://www.linuxcrazy.com
pgp.mit.edu
More information about the Tutor
mailing list