I have question about Dictionaries in Python.
here it is:
I have a dict like dict = { \'abc\':\'a\', \'cdf\':\'b\', \'gh\':\'a\', \'fh\':\'g\', \'hfz\'
dict = { \'abc\':\'a\', \'cdf\':\'b\', \'gh\':\'a\', \'fh\':\'g\', \'hfz\'
It can be done this way too, without using any extra functions .
some_dict = { 'abc':'a', 'cdf':'b', 'gh':'a', 'fh':'g', 'hfz':'g' } new_dict = { } for keys in some_dict: new_dict[some_dict[keys]] = [ ] for keys in some_dict: new_dict[some_dict[keys]].append(keys) print(new_dict)