2 ms·
> Just write: if key not in table: return default_value value = table[key] I think this could/should be shortened to value = table.get(ke
by alfons_foobar 2y ago
> Just write:
if key not in table:
return default_value
value = table[key]
I think this could/should be shortened to
value = table.get(key, default_value)
...
return value
No?
In case you disagree, I'd be happy to hear your thoughts!