AOL: Ramit Sethi Says It’s Not Too Late To Start Investing — 10 Ways To Get Started Ramit Sethi Says It’s Not Too Late To Start Investing — 10 Ways To Get Started MSN: Ramit Sethi: Stop Using This Excuse If You Want To Get Rich Ramit Sethi: Stop Using This Excuse If You Want To Get Rich AOL: Ramit Sethi: 4 Unexpected Skills You Must Have To Get Rich Ramit Sethi knows what it takes to get rich. He wrote a New York Times bestseller on the subject and runs a financial advice blog with a million readers every month. He also has a net worth of over $7 ...

Understanding the Context

MSN: How To Get Rich Even If You’re Lazy, According to Ramit Sethi Getting rich doesn’t have to mean grinding 80-hour weeks or obsessing over every penny you spend. According to bestselling author and finance expert Ramit Sethi, “being lazy is a secret weapon if you ... How To Get Rich Even If You’re Lazy, According to Ramit Sethi Here the get method finds a key entry for 'e' and finds its value which is 1. We add this to the other 1 in characters.get (character, 0) + 1 and get 2 as result.

Key Insights

When we apply this in the characters [character] = characters.get (character, 0) + 1 equation: ... It should be clear that the last equation assigns a new value 2 to the already ... 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.

Final Thoughts

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 ...