# 引用 csv 類別
import csv

# 二維表格
table = [
    ['茶飲', '價錢'],
    ['綠茶', 30],
    ['紅茶', 35]
]

with open('food2.csv', 'w', newline='') as csvfile:
    writer = csv.writer(csvfile)

    # 寫入二維表格
    writer.writerows(table)
23144f0032ee31c620218e5dafc8f9f199948420
<mask token>

<mask token>
with open('food2.csv', 'w', newline='') as csvfile:
    writer = csv.writer(csvfile)
    writer.writerows(table)

<mask token>
table = [['茶飲', '價錢'], ['綠茶', 30], ['紅茶', 35]]
with open('food2.csv', 'w', newline='') as csvfile:
    writer = csv.writer(csvfile)
    writer.writerows(table)

import csv
table = [['茶飲', '價錢'], ['綠茶', 30], ['紅茶', 35]]
with open('food2.csv', 'w', newline='') as csvfile:
    writer = csv.writer(csvfile)
    writer.writerows(table)

# 引用 csv 類別
import csv

# 二維表格
table = [
    ['茶飲', '價錢'],
    ['綠茶', 30],
    ['紅茶', 35]
]

with open('food2.csv', 'w', newline='') as csvfile:
    writer = csv.writer(csvfile)

    # 寫入二維表格
    writer.writerows(table)