Python/Dictionaries
< Python
Objective![]()
|
LessonPython dictionaries are sequences that contains a list of keys, where each key points to a value. Dictionaries act just like real life dictionaries, where the key is the word and the value is the word's definition. Dictionaries use the curly brackets ( >>> {"blue": 0, "red": 1, "green": 2} {'green': 2, 'red': 1, 'blue': 0} >>> {30: "0", 31: "1", "32": 2} {'32': 2, 30: '0', 31: '1'} >>> isinstance({}, dict) True >>> isinstance({}, set) False |
Assignments![]() |
|
This article is issued from Wikiversity - version of the Friday, April 17, 2015. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.