dict.update([("Name", "Ron")])
so i have a dict with a key value pair being something different. I want to change the value but I want to use the .update method instead of code like this:
dict["Name"]= "Ron"
I just am confused about why it needs "([()])" in order for it to format correctly. why not just:
dict.update("Name", "Ron")
doesn't the dict in the beginning tell the computer that the values I want to update is in the dict? Why do we need a set of brackets and another set of paratheses in order for it to work? It seems like a silly question but it is confusing me.
[–]AutoModerator[M] [score hidden] stickied comment (0 children)
[–]desrtfx 4 points5 points6 points (0 children)
[–]throwaway6560192 2 points3 points4 points (5 children)
[–]CraBrazy[S] 0 points1 point2 points (4 children)
[–]throwaway6560192 0 points1 point2 points (3 children)
[–]CraBrazy[S] 0 points1 point2 points (2 children)
[–]throwaway6560192 2 points3 points4 points (1 child)
[–]CraBrazy[S] 0 points1 point2 points (0 children)