Q. In python, the list L contains the following elements : ['A', 1,'1','George']. Which of the following ways of slicing would assign only the first two elements to the variable X ? (Solved)

1. l[1:2]

2. x=l[0:1]

3. x=[l[0:2]

4. none of the above

  • c. x=[l[0:2]
Subscribe Now

Get All Updates & News