We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I really don't see the point of this thing. In most cases I though about I had to check if it was empty at some point anyway or if it was present inside the list so it's just adding overhead and you still need to check. Isn't it useless in most cases ?
Plus in normal dict you can already use:
d = dict()
d.get(key, default_value)
`
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
DefaultDict Tutorial
You are viewing a single comment's thread. Return to all comments →
I really don't see the point of this thing. In most cases I though about I had to check if it was empty at some point anyway or if it was present inside the list so it's just adding overhead and you still need to check. Isn't it useless in most cases ?
Plus in normal dict you can already use: d = dict() d.get(key, default_value) `