Created
August 7, 2020 20:53
-
-
Save mayankdawar/ffd2ff6dae08e70f1c2189b7332b5c55 to your computer and use it in GitHub Desktop.
Iterate through the contents of l_of_l and assign the third element of sublist to a new list called third.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
third = [] | |
l_of_l = [['purple', 'mauve', 'blue'], ['red', 'maroon', 'blood orange', 'crimson'], ['sea green', 'cornflower', 'lavender', 'indigo'], ['yellow', 'amarillo', 'mac n cheese', 'golden rod']] | |
for i in l_of_l: | |
third.append(i[2]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment