Python .csv how to save in coloumns

I am new to Python. I want to save a list in .csv. I had syntax, but it save in rows. It should be saved in columns . Please give suggestion. Thanks
Code:
import csv
n=0
x=[]
while n < 10:
n = n+1
x.append(n)
with open(‘test.csv’,‘w’) as file:
writer = csv.writer(file)
writer.writerows([x])
print(x)

Have you knowledge about python library PANDAS

© 2017 GitHub, Inc.
with by
GitHub Education