Page 1 of 1

2) Implement the following function. def to_dict (key_lst, val_tuple) : The function takes two arguments. The first is a

Posted: Fri May 20, 2022 1:47 pm
by answerhappygod
2 Implement The Following Function Def To Dict Key Lst Val Tuple The Function Takes Two Arguments The First Is A 1
2 Implement The Following Function Def To Dict Key Lst Val Tuple The Function Takes Two Arguments The First Is A 1 (37.99 KiB) Viewed 36 times
2) Implement the following function. def to_dict (key_lst, val_tuple) : The function takes two arguments. The first is a list of strings that contains the keys for a dictionary and the second is a tuple that contains the values for the same dictionary. Both the tuple and the list are of same length and are in same order. The function constructs the dictionary and returns it. Examples: to_dict(['ki', '2', 'k3'), (7, True, 'v3')) → {'ki': 7, 'k2': True, 'k3': 'v3'} to_dict(['keyl', 'key2', 'key3'), (0, 5, 0)) + ['keyi': 0, 'key2': 5, "key3': 0} to_dict([], 0)) r