Quiles, Stephanie
2015-08-03 03:04:08 UTC
how do i go about being able to add a feature to search for individual entries that have been saved into that dictionary or else tell me that the name I entered is not found?
Here is the code that i have so far…
import pickle
def main():
infile = open("emails.dat", "rb")
emails = pickle.load(infile)
infile.close()
name_search = input("Enter a name in the file for info: ")
for name in emails:
if name[0] == name_search:
print("This is the info: ", info)
return emails
else:
print("Entry not Found! Try again.")
main()
thanks for all the help and suggestions this is really helping me in trying to figure this out!
Stephanie
_______________________________________________
Tutor maillist - ***@python.org
To unsubscribe or change subscription opti
Here is the code that i have so far…
import pickle
def main():
infile = open("emails.dat", "rb")
emails = pickle.load(infile)
infile.close()
name_search = input("Enter a name in the file for info: ")
for name in emails:
if name[0] == name_search:
print("This is the info: ", info)
return emails
else:
print("Entry not Found! Try again.")
main()
thanks for all the help and suggestions this is really helping me in trying to figure this out!
Stephanie
_______________________________________________
Tutor maillist - ***@python.org
To unsubscribe or change subscription opti