Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

It\'s always gives me the output,(\' No SSN number found for\', name). Where is

ID: 3701768 • Letter: I

Question

It's always gives me the output,(' No SSN number found for', name). Where is the problem? somehow telephone number does not link to SSN

46 if number in number_name dict.values): 47 48 49 50 51 for n in number_name_dict.keys () 52 53 54 name # Find name to which it belongs # As soon as name is found, print it if number name dict [nlnumber: name n break print (number, ' is associated with', name) 56 57 58 59 60 61 62 63 64 65 # Now check if that name is present in ssn-name dict # If yes, print it's ssn number # Else, print that ssn is not found if name in ssn_name_ dict.keys): ssn - ssn_name_dict [name] print (name + ??'s', 'SSN is', ssn) # If ssn found # Check if it's present in ssn-income-dict # If yes, print corresponding incomes # Else, print income is not found if ssn in ssn_income_dict.keys (): 67 68 69 70 71 72 73 74 else: 75 print('Therel 's no name associated with that number.' print (name's', 'annual income is', '$' ssn_income_dict[ssn]) else: print ('No details about income found for, name) else: print ('No SSN number found for', name)

Explanation / Answer

You missed at line 60: the if condition.

It's only checking tha name value once. You need to check name for all the values within ssn_name_dict.keys() . i.e. you need to add a for loop there. From code, I guess you are pretty good at coding. Also, I don't have the whole code else, I would have written the for loop for you.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote