eeyyyyyy fellow python spice enjoyers, what would you say is more "readable" / straight-forward for a nested dictionary creation/update scenario?
a = {}
b = "pumpkin"
c = "spice"
if b in a:
a[b][c] = True
else:
a[b] = {c: True}vsa = {}
b = "python"
c = "spice up ya life"
a.update({b: {c: True}})the second one is definitely less code but I feel like it's... a tich too clever. Or do people often use that second approach? I've classically stuck to the first one but.
Assume it will be read by non-python experts, as well, but that visually things are getting a little cluttered so maybe condensing some things would be nice...
#python #pythonQuestions
