What Is the meaning of this operator- [::]. And what's the difference between these two- [:] and [::] | SoloLearn: Learn to code for FREE!

0

What Is the meaning of this operator- [::]. And what's the difference between these two- [:] and [::]

Plz answer this question

5/28/2020 5:48:04 PM

Devang Soni

1 Answer

New Answer

+1

These are list slicing operations. They generally take index values but when they are not mentioned, it takes into consideration the default values which is shown below. spam = [1,2,3,4,5,6] // Both are same print(spam[:]) print(spam[0:len(spam)]) // Both are same print(spam[::]) print(spam[0:len(spam):1])