You will act out the steps of finding a web page. A dictionary plays the domain name server, and a second dictionary plays the web servers.
Your tasks.
lookup, return the IP address of name from the dictionary dns, or None if the name is not there.fetch, find the IP address with lookup. If it is None, return "DNS error". Otherwise return the page from servers[ip], or "404 Not Found" if that server does not hold the page.steps to the list of the four steps in the right order, using the four strings given.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…