View Single Post
Old Jun 12th, 2006, 1:19 PM   #7
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
One I missed. The following code for choice 5:
         for x in dbase.keys():
            print "%s:" % (x),
            for y in dbase[x]:
                if dbase[x].index(y) != len(dbase[x]) -1:
                    print "%s," % (y),
                    
                else:
                    print y
            print""
Might be better written:
for key, list in dbase.items():
    print key + ":"
    print ",".join(list)
print
Arevos is offline   Reply With Quote