convert dictionary keys 2fvalues to lowercase in python

Solutions on MaxInterview for convert dictionary keys 2fvalues to lowercase in python by the best coders in the world

showing results for - "convert dictionary keys 2fvalues to lowercase in python"
Khadija
18 May 2016
1my_dict = {'KEY1': "Hello", 'Key2': "World"} 
2new_dict = dict((k.lower(), v) for k, v in my_dict .items()) 
3print(new_dict
Zac
05 Feb 2018
1my_dict = {'KEY1': "Hello", 'Key2': "World"} 
2new_dict = dict((k.upper(), v.upper()) for k, v in my_dict .items()) 
3print(new_dict)
Jakob
21 Jan 2016
1def lower_dict(d):
2   new_dict = dict((k.lower(), v) for k, v in d.items())
3   return new_dict
4a = {'Foo': "Hello", 'Bar': "World"}
5print(lower_dict(a))
Sofia
28 Feb 2019
1my_dict = {'KEY1': "Hello", 'Key2': "World"} 
2new_dict = dict((k, v.lower()) for k, v in my_dict .items()) 
3print(new_dict)
Elif
25 Oct 2019
1def lower_dict(d):
2   new_dict = dict((k.lower(), v.lower()) for k, v in d.items())
3   return new_dict
4a = {'Foo': "Hello", 'Bar': "World"}
5print(lower_dict(a))
queries leading to this page
python convert all keys to lowercasehow to change key in dictionary to lowercasemake dictionary keys as lowerpython change all dict keys to uppercase of dictionaryhow to convert all dict keys to lower in pythonlowercase all dict inkeys pythonmake all keys in dictionary lowercasechange key to lowercase dict pythonpython convert dictionary keys to lowercasepython dictionary convert keys 26 itemas to lowercaseconvert all items in a dictionary to lower casepython make keys of dictionary lower casepython convert keys of dictionary to uppercasepython dictionary keys all lowercasepython make dict keys lowercasehow to lowercase dit keysmake all strings in dict lowercase pythonlowercase keys of dictionary pythonhow to make dictionary keys in lowercase pythonhow to lower all keys of dictionary in pythonconvert values dictionary to lowercase pythonpython lower dict keyspython lower all keys in dicthow to convert dictionary keys to lowercase pythonhow to change whole dict into lowercasechange all keys of dict to lowercaselowercase all keys in dict pythonpython convert all keys of dictionary to lowercasekey lower dict pythonhow to lowercase keys from dictionary in pythonlowercase all key and values in dictpython convert all keys of dictionary to lowercase with for looppython dictionary keys all lower caseturn all keys from dictionary to lowercase pythonconvert dictionary to lowercase pythonpython dict values to lowerlower dictionaryconvert dictionary keys to lowercase pythonpython dict lower keyslowercase dictionary pythonturn all dictionart values lowercasemake lower keys keys and values in dictionary pythonkey of dict to lowercaseturn keys of dictionary to lowercasepython change all dict keys to lowercasehow to lowercase all words in a dictionary python pythonhow to convert words in dictionary to lower case in pythonpython dictionary convert items to lowercasehow to lowercase the keys of dictionary pythonlowercase array of dict keys pythonlowercase all keys in dictionary pythonhow to use lower function in python dictionaryconvert all dictionary keys to lowercase pythonpython lowercase keys in dictlower case python valye in dictionarypython lowercase in mapconvert dict to lowercasepython dictionary convert keys to lowercaseconvert all values in dict to lower case pythonlower case to all keys of dict pythonpython key value lowerpython for key value lowercasepython dictionary change to lowercaseconvert dictionary keys 2fvalues to lowercase in python