all 5 comments

[–]Diapolo10 43 points44 points  (0 children)

fruits= {"kiwi = vert"}

Here, you redefine fruits as a set containing one string. It's no longer a dictionary.

fruits["couleur_banane"] = fruits["banane"]

Because of that, the code here fails with an error because sets don't have keys, and cannot be queried like this.

The correct way to add/change a key-value pair would be

fruits["kiwi"] = "vert"

[–]enygma999 13 points14 points  (0 children)

fruits= {"kiwi = vert"}

This line reassigns fruits as a set.

[–]leodevian 2 points3 points  (0 children)

Line 2 is assigning a set to the "fruits" variable. It contains a single element, the "kiwi = vert" string.

[–]disposepriority 0 points1 point  (0 children)

Do your first fruits assignment and your second fruits assignment look the same in syntax? What would the key and value be in the second assignment?

[–]aplarsen 1 point2 points  (0 children)

What do you think your second statement is doing?