Complete the code to access the first element of the first nested list.
nested = [[1, 2], [3, 4]] print(nested[1][0])
To get the first nested list, use [0]. Then [0] accesses its first element.
Complete the code to print the length of the second nested list.
nested = [[5, 6, 7], [8, 9]] print(len(nested[1]))
The second nested list is at index 1. Use len(nested[1]) to get its length.
Fix the error in the code to correctly access the number 10 inside the nested list.
numbers = [[4, 5], [6, 7, 8], [9, 10]] print(numbers[1][1])
The number 10 is in the third nested list, which is at index 2. Then index [1] accesses 10.
Fill both blanks to create a nested list with two inner lists, each containing numbers 1 to 3 and 4 to 6.
nested = [[1], [2]] print(nested)
The first inner list should be [1, 2, 3] and the second [4, 5, 6] to match the instruction.
Fill all three blanks to create a nested list comprehension that squares numbers 1 to 3 and 4 to 6 separately.
nested_squares = [[x[1]2 for x in range([2], 4)], [x[1]2 for x in range(4, [3])] ] print(nested_squares)
* instead of power **.The operator for power is **. The first range starts at 1, the second ends before 7 to include 6.