In: Computer Science
Write a program in Python language which will do the following:
Write a program to prompt the user to enter a company name, city, state and zip code. Create a dictionary with the data. Output the dictionary. Then remove the city from the dictionary and output again.
'''Python to enter data (company,city,state,zip) into
dictionary and
print the dictionary and remove the city from
dictionary'''
#initializing the dictionary
Dict={}
#Entering the data from user to
dictionary
Dict["company"]=input("Enter the Company name: \n")
Dict["city"]=input("Enter the City name: \n")
Dict["state"]=input("Enter the State name: \n")
Dict["zip"]=input("Enter the Zip code: \n")
#outputing the dictionary
print("Outputing the Dictionary content ",Dict)
#Removing the city from dictionary
Dict.pop("city")
#After Removing City Printing the
dictionary
print("Outputing the Dictionary content After removing city
",Dict)
Above Program Screenshot:
Output: