July 2017
Beginner to intermediate
420 pages
10h 56m
English
We can also, like we could with lists, use tuples as elements of a list.
listOfTuples = [x, y]listOfTuples
The output to the above code is as follows:
[(1, 2, 3), (4, 5, 6)]
We can create a new list that contains two tuples. So in the preceding example, we have our x tuple of (1, 2, 3) and our y tuple of (4, 5, 6); then we make a list of those two tuples and we get back this structure, where we have square brackets indicating a list that contains two tuples indicated by parentheses, and one thing that tuples are commonly used for when we're doing data science or any sort of managing or processing of data really is to use it to assign variables to input data as it's read in. I want to walk you through a little bit on what's ...
Read now
Unlock full access