Python 3.x Dictionary

dict = {}dict['d'] = 'delhi'
dict['b'] = 'bangalore'
# to get list of keys
keys = list(dict.keys())
# To get list of values
values = list(dict.values())
# Print the list of keys # output = ['d','b']
print(keys)
# Print the list of values # output = ['delhi','bangalore']
print(values)

--

--

Want to work as Freelancer, check this out : https://www.topcoder.com/gigs?referralId=84qq8h

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store