Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In Python, I'm having issues with connecting the functions and getting them to be used properly. What am I missing? my functions are not working
In Python, I'm having issues with connecting the functions and getting them to be used properly. What am I missing?
my functions are not working properly, I am not sure they are coded correctly.
'Minnie Weber', 'Geneva Pena', 'Byron Collier', 'Veronica Higgins', 'Leo Roy', 'Nelson Lopez'] list_of_names=copy.deepcopy (name_list) name_lookup =[] first_name =[] last_name =[] new_first_name =[] new_last_name =[] def name_lookup (): while Irue: if ( len (list_of_names) )=0 : print('InThat name was not found') continue first_name = list_of_names.startswith ()(0, len (list_of_names ) - 1) if le(list_of_namesirst_name]) :| print (name_lookup(list_of_names)) last_name = list_of_names.split ()(0, len ( list_of_names )1) if len (list_of_names [last_name ]) : print (name_lookup (last_name)) def_add_name (new_name): print (name_lookup(last_name)) continue Lef add_name (new_name): new_name=(new_first_name + new_last_name) 11st_of_names.append (new_name) def remove_name (delete_name): list_of_names.remove (delete_name) While Irue: print ( ) Please select from the following options: 1. Iist all first names begining with a chosen letter 2. Iist all last names begining with a chosen letter 3. Add a name 4. Delete a name 5. Exit W) fprints the menu options all nice and neat. ') \#prints the menu options all nice and neat. option_choice = input ('lnoption\#: ') \#prompts and gets the option number from the usiext if option_choice ==11 : letter = input (' What letter does the first name begin with? ') print (name_lookup) elif option_choice ==2 ' : letter = input (' What letter does the last name begin with? 's) print (name_lookup) elif option_choice ==13 : \#prompts the name to be added to the 1ist new_first_name=input (' Enter the new first name: ', ) new_last_name=input ('Enter the new last name: ') print (add_name + ' has been added.' ) input ()Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started