DSN AI+ FUTA
Published in

DSN AI+ FUTA

Getting Started with Python: Dictionaries, Tuples and Sets

Python Data types that are use for collections

Photo by Ulises Baga on Unsplash

DICTIONARIES

Creating a Dictionary

Creating Python dictionaries from iterables
Other methods of creating a Python Dictionary
More examples shown
A dictionary with different data types and how to access the different elements. Line 23 shows this better
An error occurs in Line 30 when you ask for a key that is not present in the dictionary

Dictionary methods

TUPLES

Tuples are immutable

SETS

Note the curly brackets. This does not indicate a dictionary!
Converting a list with repeated elements to a set to get the unique elements present

--

--

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