Commit b857dcaa by BellCodeEditor

save project

parent 19498a6a
Showing with 7 additions and 5 deletions
import csv import csv
a=[["姓名","性别","体育项目"],["小明","男","跳高"],["小兰","女","跑步"]]
with open("888.csv","w",encoding="utf-8")as file: with open("888.csv","w",encoding="utf-8",newline='')as file:
f=csv.writer(file) f=csv.writer(file)
f.writerow(["姓名","性别","体育项目"]) #f.writerow(["小明","男","跳高"])
f.writerow(["小明","男","跳高"]) f.writerows(a)
\ No newline at end of file \ No newline at end of file
小明,男,跳高
姓名,性别,体育项目 姓名,性别,体育项目
小明,男,跳高 小明,男,跳高
小兰,女,跑步
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment