Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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']
Step by Step Solution
★★★★★
3.43 Rating (159 Votes )
There are 3 Steps involved in it
Step: 1
Heres the implementation of the registerDomains function that uses the REST countries API to generat...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started