The function below returns the contents of the dictionary. Aside from returning the content of the dictionary, how to get all the names of the dict inside the function?
def get_ext(file_type): xsds = {'this is 1st': ['a', 'b', 'c', 'd']} rsksd = {'this is 2nd': ['1', '2', '3', '4']} as2w = {'this is 3rd': ['a', 'b', 'c', 'd']} return locals()[file_type]print (get_ext("xsds"))# Output{'this is 1st': ['a', 'b', 'c', 'd']}
Needed Output:
xsdsrsksdas2w