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.
get() returns the value associated with the key "item". If the key doesn't already exist, then it will return the "default" value (written on the right side of comma - 0) instead. So if it already exists, then it will add the previous price. Otherwise, it will add 0 to the new number.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Collections.OrderedDict()
You are viewing a single comment's thread. Return to all comments →
get() returns the value associated with the key "item". If the key doesn't already exist, then it will return the "default" value (written on the right side of comma - 0) instead. So if it already exists, then it will add the previous price. Otherwise, it will add 0 to the new number.