Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Edit Attachments Exercise 3: U.S. Exports The following code cell contains a dictionary with nominal exports of goods in millions of dollars) from the United

image text in transcribedimage text in transcribed

Edit Attachments Exercise 3: U.S. Exports The following code cell contains a dictionary with nominal exports of goods in millions of dollars) from the United States to every other country in the world in 2017. Run the code cell below to read the dictionary into memory. Edit Attachments us_exports_2017 = {'Argentina': 9585.957928, 'Serbia': 125.604552, 'Bulgaria': 381.490292, 'Bangladesh': 1473.961033, Sierra Leone': 79.185252, 'Guyana': 377.349484, 'Turkey': 9741.491989, 'Syrian Arab Republic': 6.961023, Saint Vincent and the Grenadines': 81.348131, 'Eritrea': 5.021254, 'Kosovo': 10.070786, 'Bermuda': 693.65006 'Zimbabwe': 39.926035, 'Suriname': 359.542397, "Uganda': 107.869624, 'Palau': 19.432665, 'Guinea': 103.022431 "Heard Island and Mcdonald Islands': 0.125829, 'Mongolia': 82.192362, 'Botswana': 93.045279, Cameroon': 158. 'Ecuador': 4820.700634, 'Falkland Islands (Malvinas) : 0.482089, 'Iceland': 399.258756, 'South Korea': 48326.4 'Hungary': 1888.233492, 'Comoros': 1.375097, 'Malta': 293.009573, 'Luxembourg': 1078.074731, 'Tonga': 16.7194 'Tanzania; United Republic of': 145.242068, 'Liberia': 138.340637, "Mali': 62.01555, 'Algeria': 1059.840617, South Africa': 5020.062464, 'Kyrgyzstan': 26.066859, 'Swaziland': 24.073435, 'Central African Republic': 11. 'Andorra': 3.285167, 'Seychelles': 15.488847, 'Other Countries': 0.0, 'Cook Islands': 5.243873, "Lao People's Democratic Republic": 25.67166, 'Ghana': 859.971235, Malaysia': 12964.461912, 'Micronesia (Federated States of)': 44.827548, 'Indonesia': 6863.831289, 'Tajikistan': 17.911115, 'Gambia': 3. 'Thailand': 10991.613094, 'Cape Verde': 9.146393, 'West Bank': 2.19236, 'Sri Lanka': 336.25559, 'Burma (Myanmar)': 211.368799, 'Lebanon': 1221.529041, 'Poland': 4523.318939, 'Austria': 4275.26315, 'Panama': 6301.303156, Lithuania': 609.272207, 'Hong Kong': 39939.130227, 'Kenya': 454.453344, 'Netherlands Dominican Republic': 7827.520352, 'Cayman Islands': 885.800982, 'Reunion': 8.376879, 'Belarus': 72.668182, 'Burundi': 8.13276, 'Nigeria': 2170.069073, 'Martinique': 168.255979, 'Equatorial Guinea': 111.93615, 'Vatica 'Taiwan': 25729.584439, 'Georgia': 382.865271, 'Aruba': 966.305683, 'Lesotho': 1.901616, 'Colombia': 13312.12. 'Curacao': 692.167798, 'Cuba': 291.276873, 'French Southern Territories': 2.842721, 'China': 129893.586716, 'Norway': 5453.37072, 'Svalbard and Jan Mayen Island": 1.986719, "Cte d'Ivoire" : 319.964133, 'Uruguay': 159 Montserrat': 9.708109, 'Madagascar': 53.367175, 'Vanuatu': 7.762425, 'Bhutan': 34.892754, 'Greenland': 9.884 Kuwait': 5143.414006, 'Iraq': 1284.721644, 'Senegal': 207.93405, 'Ukraine': 1787.9993, 'Haiti': 1410.575337, "Mauritius': 61.421605, 'Nicaragua': 1589.398811, 'Qatar': 3124.095821, 'Moldova, Republic of': 17.614764, 'Samoa': 38.309271, 'Saint Kitts and Nevis': 243.537203, 'Ethiopia': 877.152409, 'French Polynesia': 119.7984 Uzbekistan': 136.694699, 'East Germany': 0.0, 'Switzerland': 21684.835238, 'Rwanda': 66.140569, 'Solomon Isl Macedonia': 41.225784, 'Christmas Island': 0.476695, 'Sao Tome and Principe': 3.140792, 'Papua New Guinea': 1 Edit Attachments 1. Report the value of U.S. exports of goods to China. Print it as 'The United States exported $X billion of goods to China in 2017.' Format your string so that the number has one digit to the right of the decimal point. [Notice that the value is reported in billions.] You should look into str.format(). Edit Attachments for i in data(us_exports_2017): str - "The United States exported ${export} billion of goods to {country} in 2017." print (str.format(export = "us_exports_2017[i]", country = "us_exports_2017[i][i]")) File "", line 2 str = "The United States exported ${export} billion of goods to country in 2017." IndentationError: expected an indented block Edit Attachments 2. Report the total value of U.S. exports of goods to the entire world. Print it as 'The United States exported $X trillion dollars of goods in 2017.' Format your string so that the number has one digit to the right of the decimal point. [Hint: use the .values() method.] Edit Attachments 3. Report the total value of U.S. exports of goods to the "BRICS" countries: Brazil, Russia, India, China, and South Africa as a share of total exports. Print it as 'U.S. exports to BRICS countries accounted for X percent of total U.S. exports in 2017.' Format your string so that the number has two digits to the right of the decimal point

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions

Question

5. If yes, then why?

Answered: 1 week ago

Question

3. What changes should I be making?

Answered: 1 week ago