2. Use slicing to get the elements 2.2, 3.3 and 4.4 in one operation.
3. Use slicing to get the elements from 3.3 to the end of the list.
4. Use slicing to get the elements from the start of the list to 5.5 included.
5. Use slicing to reverse the list.
Right Answer:
# Step 1
floats = [1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8]
# Step 2
print(floats[1:4]) # Output: [2.2, 3.3, 4.4]
# Step 3
print(floats[2:]) # Output: [3.3, 4.4, 5.5, 6.6, 7.7, 8.8]
# Step 4
print(floats[:5]) # Output: [1.1, 2.2, 3.3, 4.4, 5.5]
# Step 5
print(floats[::-1]) # Output: [8.8, 7.7, 6.6, 5.5, 4.4, 3.3, 2.2, 1.1]