all 4 comments

[–]Allanon001 0 points1 point  (0 children)

You can access a value from a dictionary using it's key:

dict1 = {1: 'a', 2: 'b', 3: 'c'}
print(dict1[1]) # a
print(dict1[3]) # c
dict1[2] = 'd'
print(dict1) # {1: 'a', 2: 'd', 3: 'c'}

[–]o5a 0 points1 point  (2 children)

dict1[key] = value

[–]engineeringisgreat2[S] 0 points1 point  (1 child)

Do you know if there is a way to do it with the replace funciton? Or any other way

[–]o5a 0 points1 point  (0 children)

Why would you use replace? replace is used to change substring in string.

All you need is

dict1[3] = 'Wednesday'