Python – Difference between Uni length slicing and Access Notation
There are various ways to extract elements, Uni length slicing and Access Notations are among them. Let’s check difference between them.
Difference #1 : Different behaviour with Different Containers
The access notation return element in both List and Strings, but return 1 length strings while slicing using uni length slice and element in case of strings.
The original list : [5, 7, 2, 6, 8, 1] The original string : 572681 The access notation result for list : 6 The access notation result for string : 6 The slicing result for list :  The slicing result for string : 6
Difference #2 : No Index out of bounds Exception in case of Slice operation
There is no out of bounds exception in case of Slice Operation, but there is, in case of access notation.
The original list : [5, 7, 2, 6, 8, 1] The access notation result for list : list index out of range The slicing result for list : 
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course