When updating and adding elements of a dict object, I don't know how to do it neatly.
I understand that the following 2 methods are possible, which of the two do you prefer?
There may be factors that affect individual tastes, but I'm thinking about it because I feel that both are somewhat messy. ㅜ<
a = {original data}
# Method 1
b = {processed data}
a.update(b)
# Method 2
a[processed data] = c
a[processed data] = d
a[processed data] = e
...
I prefer the second one. I think it's more intuitive
© 2024 OneMinuteCode. All rights reserved.