Question: dict_from_string(dict_str:str)->dict Create a function named dict_from_string. This function will be given a single parameter, a string representing a dictionary. Your job is to convert the
dict_from_string(dict_str:str)->dict Create a function named dict_from_string. This function will be given a single parameter, a string representing a dictionary. Your job is to convert the string into an actual dictionary and return the dictionary. Ensure all key-value pairs in the string exist in the newly created dictionary. The string will contain only numbers or single letters as key-value pairs. Ensure all letters are kept as strings and all numbers are converted to integers in the newly created dictionary
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
