Computer Science

Given a list L1 = [3, 4.5, 12, 25.7, [2, 1, 0, 5], 88]

  1. Which list slice will return [12, 25.7, [2, 1, 0, 5]]?
  2. Which expression will return [2, 1, 0, 5]?
  3. Which list slice will return [[2, 1, 0, 5]]?
  4. Which list slice will return [4.5, 25.7, 88]?

Python List Manipulation

49 Likes

Answer

  1. L1[2:5]
  2. L1[4]
  3. L1[4:5]
  4. L1[1::2]

Answered By

24 Likes


Related Questions