SyntaxFix
Write A Post
Hire A Developer
Questions
In case of changing all the keys at once. Here I am stemming the keys.
a = {'making' : 1, 'jumping' : 2, 'climbing' : 1, 'running' : 2} b = {ps.stem(w) : a[w] for w in a.keys()} print(b) >>> {'climb': 1, 'jump': 2, 'make': 1, 'run': 2} #output