Following set of commands is executed in shell, what will be the output?
>>>str = "hello" >>>str[:2] >>>
he
Reason — str[:2] here slicing operation begins from index 0 and ends at index 1. Hence the output will be 'he'.
str[:2]