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
# 1. The variable nested contains a nested list. Assign ‘snake’ to the variable output using indexing. | |
nested = [['dog', 'cat', 'horse'], ['frog', 'turtle', 'snake', 'gecko'], ['hamster', 'gerbil', 'rat', 'ferret']] | |
output = nested[1][2] | |
print(output) | |
# 2. Below, a list of lists is provided. Use in and not in tests to create variables with Boolean values. | |
# See comments for further instructions. | |
lst = [['apple', 'orange', 'banana'], [5, 6, 7, 8, 9.9, 10], ['green', 'yellow', 'purple', 'red']] |