linnad={} tulbalaius=8 def loeLinnad(): for rida in open("teed1.txt", "r"): m=rida.strip().split() linnad[m[0]]=m[1:] def trykiTabel(): for veerulinn in ["algus"]+list(linnad.keys()): print(veerulinn.ljust(tulbalaius), end="") print() for realinn in linnad: print(realinn.ljust(tulbalaius), end="") for veerulinn in linnad: print((realinn[0]+"/"+veerulinn[0]).ljust(tulbalaius), end="") print() loeLinnad() trykiTabel()