56
Hard Python Dictionary Exercise
(lemmy.nz)
Welcome to the Python community on the programming.dev Lemmy instance!
Past
November 2023
October 2023
July 2023
August 2023
September 2023
The dict union operator is similar to that of set, but in addition the right operand overwrites values of keys of the left operand. It's a nice operator once you get used to it.
Easy to make a mistake with this exercise:
b = b | {3: []}makes a shallow copy2inaso we can still append to that and changea