Write a python program that do the following: A. Make the user enter countries and their...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a python program that do the following: A. Make the user enter countries and their capital: a. You implement a way to stop asking the user B. Create a dictionary: a. Countries are keys i. Handle duplicates keys if the user enter a duplicate key, keep the 1st value b. Capitals are values C. Display the dictionary D. Take all keys from dictionary and convert it to a list a. Reverse the key list b. Display the reversed list E. Takes all values from dictionary and make it into a set a. Display set F. Create a set with these items (Riyadh, Kuwait, Abu Dhabi,Manama, Muscat, Doha) a. Display all the capitals that do not appear in this set Write a python program that do the following: A. Make the user enter countries and their capital: a. You implement a way to stop asking the user B. Create a dictionary: a. Countries are keys i. Handle duplicates keys if the user enter a duplicate key, keep the 1st value b. Capitals are values C. Display the dictionary D. Take all keys from dictionary and convert it to a list a. Reverse the key list b. Display the reversed list E. Takes all values from dictionary and make it into a set a. Display set F. Create a set with these items (Riyadh, Kuwait, Abu Dhabi,Manama, Muscat, Doha) a. Display all the capitals that do not appear in this set
Expert Answer:
Answer rating: 100% (QA)
Given a dictionary of countries and their capitals and a set of capitals the following Python progra... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
grouper corporation produces high - performance rotors. it expects to produce 3 4 , 0 0 0 rotors in the coming year. it has invested $ 4 , 5 9 0 , 0 0 0 to produce rotors. the company has a required...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
Discuss how environment affects behavior
-
Factor each polynomial. 125k - 64k 4
-
A sample of two printed circuit boards is selected without replacement from a batch. Describe the (ordered) sample space for each of the following batches: (a) The batch contains 90 boards that are...
-
A 30.0-kg block is resting on a flat horizontal table. On top of this block is resting a 15.0-kg block, to which a horizontal spring is attached, as the drawing illustrates. The spring constant of...
-
Water flows through the orifice meter shown in Fig. P8.122 at a rate of \(0.10 \mathrm{cfs}\). If \(h=3.8 \mathrm{ft}\), determine the value of \(d\). Fig. P8.122 0- 2 in. h
-
Analyze the five national accounting practice systems summarized in this chapter. Required: a. For each of the five countries discussed in this chapter, select the most important financial accounting...
-
Required: The following are the transactions of Spotlighter, Incorporated, for the month of January. For each transaction, indicate the accounts, amounts, and direction of the effects on the...
-
Assume that a wealthy alumnus donated $1 million to Chavis University to provide loans to qualifying students. Though not required by the donor, the universitys Board of Trustees voted to supplement...
-
Write a function called filter-seq that takes a sequence s (a string) and an alphabet a (a string), and generates a result sequence (a string) by including only the characters of s that occur in the...
-
Write a Scheme program which can reverse a list Sample List: (define x '(1 2 3 4 5)) (reverse x) Sample Output: (5 4 3 2 1)
-
Q2 (45%). The melting (fusion) points of pure Germanium and pure Silicon are 940C and 14100C, respectively, and are with fully miscible in both solid and liquid states. Component Ge (A) Si (B) Tr (C)...
-
Raspberry Jam Strawberry Jam Raspberry Pints Strawberry Quarts Unit sales over the past year were downloaded from Lina's database and are in the Excel sheet "Sales", as are the prices. Additionally,...
-
Cash Flow for ABC Hotel July August September Opening Balance $ 85,000 $ 88,450 ? Cash Incoming Sales $ 67,000 $ 64,399 $ 62,500 Asset Sales $ 1,200 $ - $ - Debtor Receipts $ 2,500 $ 2,800 $ 1,300...
-
Sessions Manufacturing Company needs to expand their existing facility and needs to secure $35 million in financing to fund the expansion. Ben Bates, the CFO of Sessions Manufacturing Company, has...
-
What is Philippine most famous dish?
-
Evenflow Power Co. is considering a new project that is a little riskier than the current operations of the company. Thus, management has decided to add an additional 1.5% to the company's overall...
-
Matthew borrows $250,000 to invest in bonds. During 2012, his interest on the loan is $30,000. Matthew's interest income from the bonds is $10,000. This is Matthew's only investment income. a....
-
Sherry rents her vacation home for 6 months and lives in it for 6 months during the year. Her gross rental income during the year is $4,000. Total real estate taxes for the home are $950, and...
-
Mike purchases a heavy-duty truck (5-year class recovery property) for his delivery service on April 30, 2012. The truck is not considered a passenger automobile for purposes of the listed property...
-
For the system shown in Figure P1.10, the angular displacement of the thin disk is given by \(\theta(t)=0.03 \sin \left(30 t+\frac{\pi}{4} ight)\) rad. The disk rolls without slipping on the surface....
-
The helicopter of Figure P1.9 has a horizontal speed of \(110 \mathrm{ft} / \mathrm{s}\) and a horizontal acceleration of \(3.1 \mathrm{ft} / \mathrm{s}^{2}\). The main blades rotate at a constant...
-
Figure P1.14 shows a schematic diagram of a one-cylinder reciprocating onecylinder engine. If at the instant of time shown the piston has a velocity \(v\) and an acceleration \(a\), determine (a) the...
Study smarter with the SolutionInn App