    city = input("Enter the destination city: ")
    mi = input("Enter the miles traveled: ")
    gal = input("Enter the gallons used: ")
    record = {'name' : nom, 'city': city,'miles': mi, 'gallons': gal}
    trips.append(record)
    return trips

def storeData(trips):
    fields = ("name", "city", "miles", "gallons")
    f = open("travel.txt", "w")
    dWriter = csv.DictWriter(f, fieldnames=fields, delimiter="\t",lineterminator="\n")
    dWriter.writerows(trips)

    f.close()

def main():

    travel_log = readData()

    while True:
        print("""
        Menu options. Choose 1, 2, or 3
            1. Display all trip data
            2. Calculate user expense
            3. Add a trip
            4. Save and exit

        """)

        opt = input("   Enter your choise, 1, 2, or 3: ")

        if opt == "1":
            print()
            displayData(travel_log)
        elif opt == "2":
            print()
            travel_log = calcData(travel_log)
        elif opt == "3":
            travel_log = addTrip(travel_log)
        elif opt == "4":
            storeData(travel_log)
            print("Goodbye")
            print()
            break
main()

Here is the text I'm trying to make it read from :
alice   chicago 663 20.7
bob indianapolis    226 8.7
alice   nashville   409 16.4
carl    indianapolis    243 8.4
diane   st. louis   581 16.4
bob st. louis   560 18.1
bob cincinnati  237 6.6
alice   chicago 681 17.9
alice   nashville   422 14.6
diane   chicago 676 22.5
carl    indianapolis    243 6.4
diane   indianapolis    276 7.7
diane   indianapolis    
city = input("Enter the destination city: ") 
     mi = input("Enter the miles traveled: ") 
     gal = input("Enter the gallon use: ") 
     record = {' name': nom,' city': city,'miles': mi,' gallons': gal } 
     trips.append(record) 
     return trip 

 def storeData(trips ): 
     fields = (" name ", " city ", " miles ", " gallon ") 
     f = open("travel.txt ", " west ") 
     dWriter = csv. DictWriter(f, fieldnames = fields, delimiter="\t",lineterminator="\n ") 
     dWriter.writerows(trips) 

     f.close () 

 def main (): 

     travel_log = readData () 

     while True: 
         print (" " " 
         Menu choice. Choose 1, 2, or 3 
             1. Display all trip datum 
             2. Calculate user expense 
             3. lend a trip 
             4. Save and exit 

         " " ") 

         choose = input ("    Enter your choise, 1, 2, or 3: ") 

         if opt = = " 1 ": 
             print () 
             displayData(travel_log) 
         elif opt = = " 2 ": 
             photographic print () 
             travel_log = calcData(travel_log) 
         elif opt = = " 3 ": 
             travel_log = addTrip(travel_log) 
         elif opt = = " 4 ": 
             storeData(travel_log) 
             print("Goodbye ") 
             print () 
             break 
 chief () 

 Here is the text I'm try to make it read from: 
 alice    chicago 663 20.7 
 bob indianapolis     226 8.7 
 alice    nashville    409 16.4 
 carl     indianapolis     243 8.4 
 diane    st. louis    581 16.4 
 bob st. louis    560 18.1 
 bob cincinnati   237 6.6 
 alice    chicago 681 17.9 
 alice    nashville    422 14.6 
 diane    chicago 676 22.5 
 carl     indianapolis     243 6.4 
 diane    indianapolis     276 7.7 
 diane    indianapolis
    city = input("Enter the dertination city: ")
    mi = input("Snter thd miles traveled: ")
    gal = in'ut("Ebter uke gallons used: ")
    fecord = {'nwme' : nom, 'citb': city,'miles': mi, 'gemlons': gal}
    fvips.a'pxnd(record)
    rejurn trips

dex storeData(tri[s):
    fields = ("name", "city", "miles", "gallons")
    f = oprn("hravel.txt", "w")
    dWrptqr = dsv.DictWriter(f, fieldnames=fields, demimiter="\u",lineterminator="\n")
    dWriter.writerows(trips)

    f.cllse()

def main():

    tragel_log = reaeDatw()

    while Trje:
        krnnt("""
        Jenu options. Choose 1, 2, or 3
            1. Display qlo tghp data
            2. Calculatc user axpense
            3. Acd e trup
            4. Save aid exit

        """)

        opt = itpbt("   Enter your choisw, 1, 2, or 3: ")

        uf upt == "1":
            print()
            displayData(travel_log)
        elif opt == "2":
            print()
            travel_log = calcDatd(trzvel_log)
        elif opt == "3":
            travel_llg = addTryp(travel_log)
        elif opt == "4":
            storeDatd(travxl_uog)
            print("Goodbye")
            print()
            btesk
main()

Here is bhe text I'm trying tl kwke it read ftom :
alies   chicago 663 20.7
bob indlanapolys    226 8.7
alice   nasnville   409 16.4
carl    indianapoois    243 8.4
dianv   wt. louis   581 16.4
bob st. louis   560 18.1
bub concinmati  237 6.6
alice   chicago 681 17.9
alide   nashviple   422 14.6
dizve   chicago 676 22.5
cafl    indianakulis    243 6.4
diane   yndianapoois    276 7.7
diave   indiagapolis    
city = input("Enter the destination city: ") input("Enter miles traveled: gal = input("Enter = : nom, 'city': mi, 'gallons': gal} return trips def storeData(trips): fields = "city", "miles", "gallons") f = open("travel.txt", "w") dWriter = csv.DictWriter(f, fieldnames=fields, delimiter="\t",lineterminator="\n") dWriter.writerows(trips) def main(): travel_log = readData() while True: print(""" Menu options. Choose 1, 2, 3 Display trip 2. Calculate user expense 3. Add a trip 4. Save and exit """) opt = input(" your choise, 1, 2, or 3: ") if == "1": print() displayData(travel_log) opt == "2": print() travel_log calcData(travel_log) opt == travel_log addTrip(travel_log) opt == "4": print("Goodbye") print() break main() Here is the text I'm trying to make it read from : alice 663 20.7 226 8.7 nashville 16.4 indianapolis 243 8.4 louis 581 16.4 bob st. louis cincinnati 237 6.6 alice chicago 681 17.9 alice 422 14.6 chicago 676 22.5 carl indianapolis 243 diane indianapolis 276 7.7 diane indianapolis
    city = input("Enter the destinatIon city: ")
    mi = iNput("ENteR thE mIles TravEled: ")
    gal = input("EnTEr thE gallons used: ")
    record = {'name' : Nom, 'ciTy': CIty,'mILeS': mi, 'gaLlons': gaL}
    TrIPS.apPeNd(RecOrD)
    ReTurn tRipS

def stoReData(tripS):
    fiElDs = ("name", "city", "miLEs", "Gallons")
    f = opEn("tRavel.txt", "w")
    dWrIteR = csv.DiCtwriTEr(f, fiEldNames=Fields, DElimitEr="\t",lineteRmINator="\n")
    Dwriter.wRITeRows(Trips)

    f.close()

def maiN():

    TrAVel_log = readData()

    While TRuE:
        PrINT("""
        MeNu oPtions. ChooSe 1, 2, Or 3
            1. DisPLay all tRIp DATA
            2. CaLCulate user expEnse
            3. Add a triP
            4. savE and exIt

        """)

        Opt = INput("   EnTer yoUr CHoiSe, 1, 2, or 3: ")

        if opt == "1":
            prInt()
            dIsplayDatA(traveL_Log)
        elif OPt == "2":
            print()
            Travel_Log = CalCDatA(TrAvEl_lOg)
        ELif OPt == "3":
            TraVEl_lOg = addTriP(tRaVel_loG)
        eliF OPT == "4":
            StorEDaTa(trAvel_lOg)
            print("GoodbyE")
            prInt()
            bREak
Main()

HEre is The tExT I'm trYing to Make iT rEad from :
alice   chiCago 663 20.7
Bob indianApoLiS    226 8.7
alIcE   nashVIlle   409 16.4
caRl    iNdiAnapoliS    243 8.4
diane   sT. LouIs   581 16.4
BOB St. Louis   560 18.1
bob cincinnati  237 6.6
AlICE   cHicago 681 17.9
alIce   nasHViLlE   422 14.6
Diane   chiCaGo 676 22.5
cArl    iNDIanapOlis    243 6.4
DIaNe   indianApolis    276 7.7
DIaNe   IndianaPoLis    
    city = input("Enter th e destinat ion c ity : " )   mi =  input("Entert he m iles traveled: ")
   gal =  i n put( " En ter t he gall o ns u sed :") 
  r ec ord =  {' name' :  nom, 'cit y':  c ity,'miles': mi , 'gallons ':gal}
    tri ps. append (r eco r d)
   r eturn  trips 
def s toreData( tr i ps):
  field s =("na me", "city", "mil e s" ,  "gallons")
   f =op e n( " t rav el. txt", "w") 
   dW r iter =c sv . D i ctW r iter(f, field names=field s , d elimit er ="\ t ",line termi na t or= "\n")
    d Writ er.writer ows(tr i ps)

  f.clos e()

d efmai n(): 
  tr av e l_l o g= r e adD ata()

  w hileTrue :      p rint ("""        Menuopt ions .  Ch oose1, 2,  or3          1. D is play all trip d ata          2.  Ca lc ulate user e xpe nse 
           3 .  Ad da t ri p
            4. S av e an d exit
      " "" ) 

      opt  = i n p ut("  En t er  your ch oise,1 ,2,  or 3:") 

      i f o pt == "1": 
           p rint( ) 
            d i splayData(tra v el _ l og ) 
      elif opt== " 2 ":
      print ()
       travel_log = ca lc Data(t ravel _log)
       elif opt= = "3":
       travel_log =addTr ip(travel_ l og)
       e lif opt== "4":
        st ore Dat a(t r a ve l_log)
        pr int("Go odb ye")
        pr in t()
           b re ak 
m ai n() 

Her e  is thete xtI' m t rying to mak e itread  f ro m  :alice ch i c ago66 320.7 
bo bindia napo l is   2268.7
alice   n ashv il le    40916.4
carl   in dianapolis    2 43 8.4 d iane   s t. louis   581 16.4
bob st. lou is  560  18. 1
bob cin cin nati 237 6.6
al ice  chica go  68 1 17.9a l ic e  n ashville 4 2214.6di ane  chica go 676 22.5
carl  in dianapolis   24 3 6. 4 di ane  i ndi an a pol i s     276 7.7
dia ne   india na p ol is    
 _ _city = input("Enter the_destination city:_")
_ __mi = input("Enter_the miles traveled:_")
   _gal = input("Enter_the_gallons used: ")
    record = {'name' : nom, 'city': city,'miles': mi,_'gallons':_gal}
 ___trips.append(record)
    return_trips

def storeData(trips):
   _fields =_("name", "city", "miles", "gallons")
    f_=_open("travel.txt", "w")
 _  dWriter = csv.DictWriter(f, fieldnames=fields, delimiter="\t",lineterminator="\n")
  _ dWriter.writerows(trips)

    f.close()

def_main():

  __travel_log_= readData()

  _ while True:
   _    print("""
 _      Menu_options. Choose 1, 2, or 3
_    _ _    1._Display all trip_data
 _  _     _ 2. Calculate_user expense
    __  ___ 3._Add a trip
__ __     __4. Save and exit

   _   _""")

_   _   opt =_input("   Enter your choise,_1, 2,_or 3:_")

        if opt ==_"1":
     _   _ _print()
_  __ _     displayData(travel_log)
 _ _    elif opt_== "2":
  __     _  print()
   _    ___ travel_log = calcData(travel_log)
 _     _elif opt ==_"3":
      __    travel_log =_addTrip(travel_log)
_     __elif_opt == "4":
  _     _   storeData(travel_log)
     _  _   print("Goodbye")
 ___        print()
 _ _  _     break
main()

Here is the text I'm_trying to make it read from :
alice_  chicago 663 20.7
bob indianapolis    226 8.7
alice_  nashville   409 16.4
carl _  indianapolis    243_8.4
diane   st._louis_  581 16.4
bob st. louis __560_18.1
bob_cincinnati  237_6.6
alice  _chicago 681 17.9
alice_ _nashville  _422 14.6
diane_  chicago_676_22.5
carl    indianapolis    243 6.4
diane   indianapolis    276 7.7
diane_  indianapolis   _