Spoiler
I'm in a big rush I got a python homework due tonight haha. sucks for me.I was wondering if anyone could lend a big hand:
i was wondering if someone could help me understand on how to save files with python, and load them.
so i have got this code on how to add names into a "phonebook"
but how can i allow the user to save it as a text file after entering the information
old useless info
i was wondering if someone could help me understand on how to save files with python, and load them.
so i have got this code on how to add names into a "phonebook"
but how can i allow the user to save it as a text file after entering the information
phone_book = {} inverse_phone_book = {} def add_numbers_to_phone_book(): to_add = int(input('How many numbers do you \ want to add? ')) for number in range(to_add): key = input('What is the name of the person? ') item = input('What is the number of that person? ') phone_book[key] = item def reverse_phonebook(): for key in phone_book: value = phone_book[key] last = [] last.append(key) if value in inverse_phone_book: inverse_phone_book[value].append(key) else: inverse_phone_book[value] = last
old useless info
Spoiler
first assignment: http://nlp.cs.nyu.ed...-2011/Xtra.htmlslides 14-18 here: http://cs.nyu.edu/co...-004/index.html* i don't exactly know how to do thissecond assignment: http://nlp.cs.nyu.ed...-2011/HW10.htmlthe sources we used: http://cs.nyu.edu/co...04_phonebook.py*I'll start working on this.** one doneIf you guys play neopets, I can give you a couple older neopet shells I have created and rarely used. Or I can shed out some neopoints I got from imageclick on my old accounts.thank you ahead of time!!!my msn is:[email protected] u guys can also get some free pdfs by visiting here: http://colorfulsharp...om/Locked/menu/ logged in using the username and password
first assignment: http://nlp.cs.nyu.ed...-2011/Xtra.htmlslides 14-18 here: http://cs.nyu.edu/co...-004/index.html* i don't exactly know how to do thissecond assignment: http://nlp.cs.nyu.ed...-2011/HW10.htmlthe sources we used: http://cs.nyu.edu/co...04_phonebook.py*I'll start working on this.** one doneIf you guys play neopets, I can give you a couple older neopet shells I have created and rarely used. Or I can shed out some neopoints I got from imageclick on my old accounts.thank you ahead of time!!!my msn is:[email protected] u guys can also get some free pdfs by visiting here: http://colorfulsharp...om/Locked/menu/ logged in using the username and password
Edited by ~*DK*~, 04 May 2011 - 07:05 PM.