shekhar pandey
1 min readJan 12, 2020

--

Thanks for your post.

Inspired by your post I tried to do this in a single line

Original dictionary :
d = {‘id’:1, ‘fname’:’Jonathan’, ‘lname’:’Hsu’}

# to create a new dictionary where keys are in upper case
d_new = {k.upper():d[k] for k in d.keys()}

--

--

No responses yet