import csv rowlist=[{'first_name': 'mark', 'last_name': 'zhao','age':21}, {'first_name': 'tony', 'last_name': 'wang','age':22}, {'first_name': 'hengry', 'last_name': 'zhang','age':23},] #newline设置为空 with open('names.csv', 'w',newline='') as csvfile:…