I recently came across this way of slicing a list in Python. I've never seen this one before, so I would like to understand this clearly.
I have a list ["Peter", "James", "Mark"] and if I slice it using the boolean value False it returns Peter and if I slice using True it returns James, as given below
["Peter", "James", "Mark"][False] => Peter["Peter", "James", "Mark"][True] => James
I would like to know what happens here and what is this method called as?