Yours is a simple, equally elegant answer, Flying Dutchman.
I got the original code here:
Next challenge for me (no small one) to look at ultimately developing this to:
Prompts (R/ead, A/dd, L/ist all, P/rint, W/rite, Q/uit)
While != 'q"
Read - Read name, email address, phone for Name(User Input)
Add - Add new name, email address, phone until Q (Write? (Y/N)
L/ist - Show all entries format: name, email address, phone
P/rint - Print formatted list: format: name, email address, phone
Quit - If Add, prompt for Write, otherwise Quit
Seems like an accessible challenge for learning to code in Python.
That's my goal.
This is just the stepping off point.
Haven't really looked While Loops yet, if/then loops or file I/O.
I've seen some stuff.
Question. Changing "zip to dip" breaks the program
error "dip" is not defined.
"zip" isn't defined either:
" for field, answer in zip(fields, answers): "
Is it an internal function to python or what am I missing?
Nevermind. Search is my friend:
"This function returns a list of tuples, where the i-th tuple contains the i-th element from each of the argument sequences or iterables. The returned list is truncated in length to the length of the shortest argument sequence. When there are multiple arguments which are all of the same length, zip is similar to map with an initial argument of None. With a single sequence argument, it returns a list of 1-tuples. With no arguments, it returns an empty list."
Now to look up "tuples".