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 ?

  • (A) l[1:2]
  • (B) x=l[0:1]
  • (C) x=[l[0:2]
  • (D) none of the above
πŸ’¬ Discuss
βœ… Correct Answer: (C) x=[l[0:2]

You must be Logged in to update hint/solution

πŸ’¬ Discussion

πŸ“Š Question Analytics

πŸ‘οΈ
100
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Vinay
Publisher
πŸ“ˆ
96%
Success Rate