Question: Write a Python program that creates and uses following dictionary, which maps country name to Internet top - level domains ( TLDs ) : tlds
Write a Python program that creates and uses following dictionary, which maps country name to Internet toplevel domains TLDs:
tlds Canada:caUnited States:usMexico:mx
Perform the following tasks and display the results:
Check whether the dictionary contains the key Canada
Check whether the dictionary contains the key France
Iterate through the keyvalue pairs and display them in twocolumn format
Add the keyvalue pair Sweden and swwhich is incorrect
Update the value for the key Sweden to se
Use a dictionary comprehension to reverse the keys and values
With the result of part F use a dictionary comprehension to convert the country name to all uppercase letters
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
