[Tutor] newbie question

jon vspython jonvspython at gmail.com
Thu Oct 18 22:49:19 CEST 2007


>From http://diveintopython.org/getting_to_know_python/index.html, we can get
this solution which works no matter the size of the dictionaries:

print ' '.join(["%s" % (v,) for k,v in menu_specials.items()])

It generates a formatted string for value in the dictionary and then joins
them using white spaces.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20071018/499c465f/attachment.htm 


More information about the Tutor mailing list