What is the effect of dict access followed by colon operation in python?

Viewed 26

The following code does not cause an error, but it has no effect:

d = {"name": "Joey"}
d["age"]: 1

Notice that there's a typo, it should be = rather than :, how does python understand it?

0 Answers
Related