Slicing Operation In Python Code