0 like 0 dislike
ago in Tutorial & Interview questions by (7k points)

1 Answer

0 like 0 dislike
ago by (7k points)
Best answer


# Initializing the dictionary 

details = {'Title':'Dr','Given name':'Ram','Middle name':'Kumar','Surname':'Sharma','Age': 50}

# Printing the content of the dictionary

print (details['Title'])
print (details['Given name'])
print (details['Middle name'])
print (details['Surname'])
print (details['Age'])

# Adding new content to the dictionary 

details['Height'] = 5*10+2
print (details['Height'])

details[1] = 'PhD'
print (details[1])

details[2] = 'Machine Learning'
print (details[2])

# Print all the data in the dictionary 

print (details) 

Register fast for winter training program at Goeduhub Technologies. We are providing winter training in AI-ML, IoT, Python, Hadoop and PLC-SCADA.

[[ CALL - 07976731765 ]]