'python: how to put element in the right column of csv file?

Good Morning i just opened another post but was closed because someone wrote is duplicated... i don't know

I have a csv file with 3 headers and now i need to add the elements estracted in each column, my code add the elements only in the first column, how i can change it?

import csv

from = "12/03/2022"
to = "19/03/2022"
price = "350"

with open('voli.csv','r+') as file:
file.write("FROM TO COST")
file.write("\n")
file.write(from)
file.write(to)
file.write(price)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source