Report Bug

QusSuppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], Which of the following is correct syntax for slicing operation? Qusमान लीजिए कि लिस्ट 1 है [4, 2, 2, 4, 5, 2, 1, 0], निम्न में से कौन सा स्लाइसिंग ऑपरेशन के लिए करेक्ट सिन्टैक्स है?


A. print(list1[0])
B. print(list1[:2])
C. print(list1[:-2])
D. all of the mentioned


Solution
D. all of the mentioned



Explanation
Slicing is allowed in lists just as in the case of strings.
CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad