For this assignment, use the REST countries API (https://restcountries.com/#api-endpoints-v2). For all of your requests, make sure...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
For this assignment, use the REST countries API (https://restcountries.com/#api-endpoints-v2). For all of your requests, make sure you to use version 2 of the REST countries API (V2), not version 3 (V3.1). If you make a request with the URL: https://restcountries.com/v2/alpha/usa, you will receive the following response: { "name": "United States of America", "topLevelDomain": [".us"], "alpha2Code":"US", "alpha3Code": "USA", "callingCodes": ["1"], "capital": "Washington, D.C.", } If f you make a request with an invalid URL, you will receive the following response: { } "status": 400, "message": "Bad Request" Register Domains Function Name: register Domains() Parameters: company Name (str), country List (list) Returns: list of domain names (list) Description: You've just started a new company and you want to register your company's website in countries around the world. To create a domain name for your website in a country, you'll need to obtain the "top level domain" for that country and add it to the end of your company's name, all in lowercase. Given a list of country names, write a function that returns a list of new domain names for these countries. The order of these domain names should correspond to the original order of country List. If a country name is invalid, simply skip over that country. ex. >>> companyName = 'Google' >>> country List = ['france', 'japan', 'canada'] >>> register Domains(company Name, countryList) ['google.fr', 'google.jp', 'google.ca'] >>> companyName = 'Amazon' >>> countryList = ['germany', 'narnia', 'mexico', 'hogwarts'] >>> registerDomains(company Name, countryList) ['amazon.de', 'amazon.mx'] For this assignment, use the REST countries API (https://restcountries.com/#api-endpoints-v2). For all of your requests, make sure you to use version 2 of the REST countries API (V2), not version 3 (V3.1). If you make a request with the URL: https://restcountries.com/v2/alpha/usa, you will receive the following response: { "name": "United States of America", "topLevelDomain": [".us"], "alpha2Code":"US", "alpha3Code": "USA", "callingCodes": ["1"], "capital": "Washington, D.C.", } If f you make a request with an invalid URL, you will receive the following response: { } "status": 400, "message": "Bad Request" Register Domains Function Name: register Domains() Parameters: company Name (str), country List (list) Returns: list of domain names (list) Description: You've just started a new company and you want to register your company's website in countries around the world. To create a domain name for your website in a country, you'll need to obtain the "top level domain" for that country and add it to the end of your company's name, all in lowercase. Given a list of country names, write a function that returns a list of new domain names for these countries. The order of these domain names should correspond to the original order of country List. If a country name is invalid, simply skip over that country. ex. >>> companyName = 'Google' >>> country List = ['france', 'japan', 'canada'] >>> register Domains(company Name, countryList) ['google.fr', 'google.jp', 'google.ca'] >>> companyName = 'Amazon' >>> countryList = ['germany', 'narnia', 'mexico', 'hogwarts'] >>> registerDomains(company Name, countryList) ['amazon.de', 'amazon.mx']
Expert Answer:
Answer rating: 100% (QA)
Heres the implementation of the registerDomains function that uses the REST countries API to generat... 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
-
For this assignment use the Internet to research highrisk investment brokerage firms that have been indicted or convicted of ethical violations to provide insight and understanding of this market...
-
Your US company sends you on an assignment in Spain for 3 months. They advance you $200 per day (per diem), or $18000. You pay for your hotel, meals, etc. with your US issued credit card. During your...
-
If X has an F distribution with v1 and v2 degrees of freedom, show that Y = 1/X has an F distribution with v2 and v1 degrees of freedom.
-
Let v = (2, 5) and w = (3, 2). Find the length of v + w.
-
Financial institutions usually require collateral as part of a lending agreement. For example, loans to build shopping centers usually require the property to be put up as collateral in case the...
-
Jim Corner, owner of Corner Bike Rentals, wants to start analyzing his companys quality. For each bike rental, there are four types of customer complaints: bike not working properly, bike wrong size,...
-
Determine the missing amounts in the following accounting equations. 1. Label each of the transactions in the preceding analysis with the correspon ding letter of the description that best fits it:...
-
You have completed your audit of Carter Corporation and its consolidated subsidiaries for the year ended December 31, 2014, and are satisfied with the results of your examination. You have examined...
-
Randy's Restaurant Company (RRC) entered into the following transactions during a recent year. April 1 Purchased equipment (a new walk-in cooler) for $8,800 by paying $2,900 cash and signing a $5,900...
-
On January 1, Year 2, PAT Ltd. acquired 90% of SAT Inc. when SAT's retained earnings were $1,000,000. There was no acquisition differential. PAT accounts for its investment under the cost method. SAT...
-
A material is said to be transparent if A. light can pass freely through it in a straight line. B. it absorbs light and redistributes the energy as thermal energy. C. it reflects light. D. it can...
-
Automated Teller Machines (ATM) are designed so that users will provide a personal identification number (PIN) and a card to access their bank accounts. Give examples of confidentiality, integrity...
-
The Wagner Corporation has a $23 million bond obligation outstanding, which it is considering refunding. Though the bonds were initially issued at 15 percent, the interest rates on similar issues...
-
Bill and Natalia Martinez Today, January 1, 2021, Bill and Natalia Martinez have come to your firm for help in developing a plan to accomplish their financial goals. From your initial meeting...
-
Music Matters are interested in understanding how their earnings relate to the overall Musical Instrument market. Your manager has asked you to explore the market earnings to support the developments...
-
What role does genetic drift play in the divergence of populations and the eventual emergence of new species ? Explain
-
Please give feedback? I believe that there are certain forms of discriminatory hiring which is impossible to avoid, "The anti-discrimination laws are not absolute. Some jobs may call for an...
-
Use the formula to determine the value of the indicated variable for the values given. Use a calculator when one is needed. When necessary, use the key on your calculator and round answers to the...
-
William sold Section 1245 property for $25,000 in 2012. The property cost $35,000 when it was purchased 5 years ago. The depreciation claimed on the property was $16,000. a. Calculate the adjusted...
-
Tom has a successful business with $100,000 of income in 2012. He purchases one new asset in 2012, a new machine which is 7-year MACRS property and costs $25,000. If you are Tom's tax advisor, how...
-
Steve Jackson (age 51) is a single taxpayer living at 3215 Pacific Dr., Del Mar, CA 92014. His Social Security number is 465-88-9415. In 2012, Steve's earnings and income tax withholding as the...
-
What knowledge of the EDP system should the auditor acquire in obtaining an understanding?
-
a. Under what circumstances can tests of controls be performed without the use of the computer? b. What are the advantages and disadvantages of auditing around the computer?
-
a. Under what circumstances may it be advantageous to test controls with the computer? b. What are the disadvantages of auditing through the computer?
Study smarter with the SolutionInn App