Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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
Source by www.datasciencelearner.com #
 
PREVIOUS NEXT
Tagged: #python #code #convert #keys #dict #lowercase
ADD COMMENT
Topic
Name
1+5 =