Python programming

profileJChoiseul
fileappend.py

#fileappend.py #This program demonstrates how to append a text file in a comma delimited format def main(): #Declare variables #string make, model make = model = "" #int year year = 0 #Prompt for make model and year make = input("Enter the make of the car: ") model = input("Enter the model of the car: ") year = eval(input("Enter the year of the car: ")) outfile = open("cars.txt", "a") #a will create the file if it doesn not exist #It will add to the end of the file if it does #Write the data to file in comma delimited format outfile.write(make + "," + model + "," + str(year) + "\n") #close file outfile.close()