I have this dictionary of lists:
Dict = {'Name':['John','Seth'], 'Gender':['Male','Male'], 'Zip':['68112','22200']}
How to iterate through the keys of this list and make them in lowercase?
The output should be like:
Dict = {'name':['John','Seth'], 'gender':['Male','Male'], 'zip':['68112','22200']}
I have reviewed the solution by Rich Copeland, but It was not evident to me how to apply.
Any idea how to solve this?
|
I figured out how to fix it! here, use this:
Dict = {'Name':['John','Seth'], 'Gender':['Male','Male'], 'Zip':['68112','22200']}
for key in Dict:
Dict[key.lower()] = Dict.pop(key)
print(Dict)
~Jack Burch
sorry, the thread was closed so I couldn't comment it.