1my_dict = {'KEY1': "Hello", 'Key2': "World"}
2new_dict = dict((k.lower(), v) for k, v in my_dict .items())
3print(new_dict
1my_dict = {'KEY1': "Hello", 'Key2': "World"}
2new_dict = dict((k.upper(), v.upper()) for k, v in my_dict .items())
3print(new_dict)
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))
1my_dict = {'KEY1': "Hello", 'Key2': "World"}
2new_dict = dict((k, v.lower()) for k, v in my_dict .items())
3print(new_dict)
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))