Yahoo: 12 Ways to Get Smoke Smells Out of Clothes & When to Call the Pros
12 Ways to Get Smoke Smells Out of Clothes & When to Call the Pros
MSN: How to Get the Smoke Smell out of Your Clothes (So They Stop Smelling Like Campfire)
How to Get the Smoke Smell out of Your Clothes (So They Stop Smelling Like Campfire)
Add Yahoo as a preferred source to see more of our stories on Google. krblokhin / iStock / Getty Images Plus via Getty Images Lingering smoke smells from a summer campfire or an unplanned interaction ...
AOL: The Best Ways to Get Rid of Smoke Smell in Your Home and Refresh the Air
The Best Ways to Get Rid of Smoke Smell in Your Home and Refresh the Air
Try this before you get rid of your smoky clothes for good. Whether your sweatshirt smells like the campfire from the night before or you bought pre-owned clothing that is still carrying around the ...
The sample code in your question is clearly trying to count the number of occurrences of each character: if it already has a count for a given character, get returns it (so it's just incremented by one), else get returns 0 (so the incrementing correctly gives 1 at a character's first occurrence in the string).
As you have found, get just gets the value corresponding to a given key. sorted will iterate through the iterable it's passed. In this case that iterable is a dict, and iterating through a dict just iterates through its keys. If you want to sort based on the values instead, you need to transform the keys to their corresponding values, and of course the obvious way to do this is with get. To ...