Revision: 51658
Updated Code
at October 3, 2011 04:26 by denakitan
Updated Code
myFavoriteGhibliMoviesReleaseYearDict = { 'Whisper of the Heart' : '1995', 'Princess Mononoke' : '1997', 'Spirited Away' : '2001' } if 'Spirited Away' in myFavoriteGhibliMoviesReleaseYearDict: print('\'Spirited Away\' release year: ' + myFavoriteGhibliMoviesReleaseYearDict['Spirited Away']) else: print('\'Spirited Away\' release year not found.')
Revision: 51657
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at September 30, 2011 23:42 by denakitan
Initial Code
myFavoriteGhibliMoviesReleaseYearDict = { 'Whisper of the Heart' : '1995', 'Princess Mononoke' : '1997', 'Spirited Away' : '2001' } if 'Spirited Away' in myFavoriteGhibliMoviesReleaseYearDict: print '\'Spirited Away\' release year: ' + myFavoriteGhibliMoviesReleaseYearDict['Spirited Away'] else: print '\'Spirited Away\' release year not found.'
Initial URL
Initial Description
Snippet to verify whether or not a key exists in a python dictionary.
Initial Title
Python - Dictionary - Does key exist?
Initial Tags
python
Initial Language
Python