Jan-30-2020, 02:00 PM
import pickle import csv with open('file.csv','a',newline="") as f: thewriter=csv.writer(f) thewriter.writerow([' name',' adult','child','reference']) ref=-1 av_seats=152 while True: ad=int(input("Enter a adult ")) ch=int(input("Enter a children ")) name=input("Plese enter your name") totoal=ad+ch av_seats=av_seats-totoal ref=ref+1 thewriter.writerow([name,ad,ch,ref]) print("left are ",av_seats) op=input("press 'n' to terminate or any key to stop ").lower() if op=='n': break