write python code to create a dictionary 'D' to include the following states and their capital as keys and values respectively and display dictionary D
states capitals
Gujarat Gandhinagar
Haryana Chandigarh
Maharashtra Mumbai
Meghalaya Shillong
Answers
Answered by
0
Explanation:
states = dict( )
n = int(input("How many states are there: "))
for i in range:
state = input("Enter name of the state: ")
capital = input("Enter name of the capital : ")
print("Created dictionary is: ", states)
temp = input("Enter the estate to display capital: ")
print(states[temp])
Similar questions