import csv

data = [{'mountain' : 'Everest', 'height': '8848'},
      {'mountain' : 'K2 ', 'height': '8611'},
      {'mountain' : 'Kanchenjunga', 'height': '8586'}]

with open('peak.csv', 'w') as csvFile:

    fields = ['mountain', 'height']
    writer = csv.DictWriter(csvFile,
                            fieldnames=fields)
    writer.writeheader()
    writer.writerows(data)

print("writing completed")

csvFile.close()
41817300454c40e909945cfd3c766461e0f003c6
<mask token>

<mask token>
with open('peak.csv', 'w') as csvFile:
    fields = ['mountain', 'height']
    writer = csv.DictWriter(csvFile, fieldnames=fields)
    writer.writeheader()
    writer.writerows(data)
print('writing completed')
csvFile.close()

<mask token>
data = [{'mountain': 'Everest', 'height': '8848'}, {'mountain': 'K2 ',
    'height': '8611'}, {'mountain': 'Kanchenjunga', 'height': '8586'}]
with open('peak.csv', 'w') as csvFile:
    fields = ['mountain', 'height']
    writer = csv.DictWriter(csvFile, fieldnames=fields)
    writer.writeheader()
    writer.writerows(data)
print('writing completed')
csvFile.close()

import csv
data = [{'mountain': 'Everest', 'height': '8848'}, {'mountain': 'K2 ',
    'height': '8611'}, {'mountain': 'Kanchenjunga', 'height': '8586'}]
with open('peak.csv', 'w') as csvFile:
    fields = ['mountain', 'height']
    writer = csv.DictWriter(csvFile, fieldnames=fields)
    writer.writeheader()
    writer.writerows(data)
print('writing completed')
csvFile.close()

import csv

data = [{'mountain' : 'Everest', 'height': '8848'},
      {'mountain' : 'K2 ', 'height': '8611'},
      {'mountain' : 'Kanchenjunga', 'height': '8586'}]

with open('peak.csv', 'w') as csvFile:

    fields = ['mountain', 'height']
    writer = csv.DictWriter(csvFile,
                            fieldnames=fields)
    writer.writeheader()
    writer.writerows(data)

print("writing completed")

csvFile.close()