Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

convert dictionary keys/values to lowercase in python

def lower_dict(d):
   new_dict = dict((k.lower(), v) for k, v in d.items())
   return new_dict
a = {'Foo': "Hello", 'Bar': "World"}
print(lower_dict(a))
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #convert #dictionary #lowercase #python
ADD COMMENT
Topic
Name
9+7 =