2012-11-14 107 views
-1

可能重複:
whats another way to write python3 zippython3 for循環字典

什麼更好的方式來寫這些東西我被介紹給這些代碼,但我不習慣看到他們這些方式:

(alla,allc,) = (set(s) for s in zip(*animaldictionary.keys())) 
你還能怎麼寫這個
print('\n'.join(['\t'.join((c,str(sum(animaldictionary.get(ac,0) 
for a in alla 
    for ac in ((a,c,),))//12))) 
      for c in sorted(allc)])) 
+3

這似乎正是先前[這裏](HTTP問同樣的問題:/ /stackoverflow.com/questions/13371279/whats-another-way-to-write-python3-zip)(我的回答很好)。沒有必要再問一次! – Blckknght

回答