import pandas as pd
data = {'Product': ['Desktop Computer','Tablet','Printer','Laptop'],
'Price': [850,200,150,1300]
}
df = pd.DataFrame(data, columns= ['Product', 'Price'])
df.to_csv(r'Path where you want to store the exported CSV file\File Name.csv')
# df.to_csv('file_name.csv', encoding='utf-8', index=False)
print (df)
data[['column1','column2','column3',...]].to_csv('fileNameWhereYouwantToWrite.csv')
df = pd.DataFrame()
for i in range():
#....
df.appen(text)