update a value in dict ython
d = {1: "one", 2: "three"}
d1 = {2: "two"}
# updates the value of key 2
d.update(d1)
#Output
{1: 'one', 2: 'two'}
update a value in dict ython
d = {1: "one", 2: "three"}
d1 = {2: "two"}
# updates the value of key 2
d.update(d1)
#Output
{1: 'one', 2: 'two'}
how to change key to value and versa in python dictionary
dict = {value:key for key, value in dict.items()}
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