modify dict key name python
a_dict[new_key] = a_dict.pop(old_key)
modify dict key name python
a_dict[new_key] = a_dict.pop(old_key)
python change dict key value
# an example of creating a new dict key from an existing one, then deleting the old key
d = {"cow": "animal", "rose": "flower"}
d["horse"] = d["cow"]
del d["cow"]
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us