Answers for "How to use lower function in python dictionary"

0

python code to convert all keys of dict into lowercase

my_dict = {'KEY1': "Hello", 'Key2': "World"} 
new_dict = dict((k.lower(), v) for k, v in my_dict .items()) 
print(new_dict
Posted by: Guest on December-08-2020

Code answers related to "How to use lower function in python dictionary"

Python Answers by Framework

Browse Popular Code Answers by Language