Python | Nifty lil thang

/ 26 Aug 2013 /
Well, this could come in useful soon.



n = {}
for line in open('french.txt'):
    english, french = line.split()
    n[english] = french
    
    
n2 = {}
for line in open('french.txt'):
    french, english = line.split()[::-1]
    n2[french] = english
    
    
n.update(n2)


for k, v in n.items():
  print(k, ':', v)
 
Copyright © 2010 M(ath)+me, All rights reserved