On 19/05/17 15:23, Michael C wrote:
> list(read_dictionary) converts the dictionary into a list right? How can
> you save the list as a dictionary?

Nope, list() produces a new list object containing the
keys of the dictionary. In the old day(of python 2) you
used to get the same effect using

for key in mydict.keys()

but keys() now returns a funky view of the original dict
keys and I suspect you'd have the same problems when
deleting items. So Peter's list() is probably the best
option.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to