这是我的第二个清单:
weapons = [['cannon','sword','bow','catapult','longbow','longsword','scythe','frying pan'],['bayonet','karambit','tommy gun']]
答案 0 :(得分:2)
Python的CSV库具有以下功能:
import csv
with open("output.csv", "wb") as f:
writer = csv.writer(f)
writer.writerows(weapons)