← Back to Dictionaries
Question 297
Who Has This Number
Who Has This Number
The dict book maps names to phone numbers. Read a number from the input (one line, no prompt) and find the name it belongs to with a loop over the keys, comparing each key's value with the number. Print the name in the form Found: <name>, or Nobody when no value matches. Keep a variable for the name found, starting empty, so the message is printed once after the loop. Input: one line. Output: one line.
Expected Output:
Found: Omar= newline. The output ends with a newline — print one after the last line.
Hints3 available
Sign in to use hintsTopics:
Dictionaries
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.