Menu

[solved]-Typing Import Dict Def Reverselookupdictionary Phonenum Str Phonetoname Dict Str Str Str F Q39018026

from typing import Dict def reverse_lookup_dictionary(phone_num: str, phone_to_name: Dict[str, str]) -> str: This function

from typing import Dict def reverse_lookup_dictionary(phone_num: str, phone_to_name: Dict[str, str]) -> str: “”This function receives a phone number phone_num, and a dictionary phone_to_name in which each key is a phone number and each value is the name associated with that phone number. Return the name associated with phone_num in phone_to_name, or an empty string if there is no match. >>> reverse_lookup_dictionary(“416-555-3498”, {“416-555-3498”: “John A. Macdonald”, “647-555-9812”: “Louis Riel”, “416-555-6543”: “Canoe Head”, “905-555-6681″:”Tim Horton”}) ‘John A. Macdonald’ Show transcribed image text from typing import Dict def reverse_lookup_dictionary(phone_num: str, phone_to_name: Dict[str, str]) -> str: “”This function receives a phone number phone_num, and a dictionary phone_to_name in which each key is a phone number and each value is the name associated with that phone number. Return the name associated with phone_num in phone_to_name, or an empty string if there is no match. >>> reverse_lookup_dictionary(“416-555-3498”, {“416-555-3498”: “John A. Macdonald”, “647-555-9812”: “Louis Riel”, “416-555-6543”: “Canoe Head”, “905-555-6681″:”Tim Horton”}) ‘John A. Macdonald’

Expert Answer


Answer to from typing import Dict def reverse_lookup_dictionary(phone_num: str, phone_to_name: Dict[str, str]) -> str: “”This func… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *