The dictionary in python associates key with values and written with in {} curly braces as shown below.
l={‘punjab’:’chandigarh’,’haryana’:’chandigarh’,’himachal’:’shimla’,’up’:’lukhnow’}
Keys: states names are keys (punjab, haryana, himachal, up)
Values: Each key has values assigned to it in this case chandigarh,shimla,lukhnow are the values.
Any values associated with key can be checked by typing dictionary [Key].The keys and values are also checked by its function keys l.keys and values l.values as shown in image above.
Sets are writen with curley braces but without colons as shown in image below.
Even it had some value twice but it returned only unique values and eliminated duplicacy.
[…] To update element in dictionary dict.update is […]