## ← Population Solution - Intro to Computer Science

• 2 Followers
• 12 Lines

### Get Embed Code x Embed video Use the following code to embed this video. See our usage guide for more details on embedding. Paste this in your document somewhere (closest to the closing body tag is preferable): ```<script type="text/javascript" src='https://amara.org/embedder-iframe'></script> ``` Paste this inside your HTML body, where you want to include the widget: ```<div class="amara-embed" data-url="http://www.youtube.com/watch?v=H-eGAkgjg_s" data-team="udacity"></div> ``` 2 Languages

Showing Revision 6 created 05/25/2016 by Udacity Robot.

1. So here's one way to solve the quiz; we're going to create a dictionary
2. called Population, and then we'll add some cities to it. We'll add Shanghai,
3. has population 17.8 million. Istanbul has population
4. 13.3 million. Karachi has population 13 million, and
5. Mumbai has population 12.5. I'm also going to add my home town,
6. which is Charlottesville, and the population of Charlottesville is pretty small
7. compared to Shanghai. It is 0.043 million people. Only 43,000. So now we've
8. created our dictionary. We've populated it with some entries. We can print those
9. out. So if we look at the value of population of Shanghai,
10. that will get that entry in the dictionary, and we can see that we get the
11. result 17.8; we can also print out the
12. population of Charlottesville, and we get the result 0.043