3つのリスト(年、動物、売上)からテキストファイル(outfile.txt)を書き出すには?
years=['2009','2010']
animals=['horse','cat','dog','cow','pig']
sales=[[2,300,700,50,45],[4,9,55,69,88]]
with open ('outfile.txt','w' as outfile):
outfile.write(???
outfile.txt は次のようになります。
animals years_2009 years_2010
horse 2 4
cat 300 9
dog 700 55
cow 50 69
pig 45 88