I want to get the element in the last index of a list, but sometimes the last index is a list, in this case I want the first element in the nested list.

```
#list in moment 1:
Lm1 = [1,2,3,4]

#list in moment 2:
Lm2 = [1,2,3,4,[1,2,3]]

```

I can just use an if for this.

```
#Option1:

def if_list(lastposition):
    if isinstance(lastposition, list):
        return list[0]
    else:
        return lastposition

element = if_list(Lm1[-1])
do whatever

```

Or if I want to do the same operation in both cases I could buit the list like this and use the same slice notation. It will give the element I want.

```
#Option2:

Lm1 = [[1],[2],[3],[4]]
Lm2 = [[1],[2],[3],[4],[1,2,3]]

Lm1[-1][0]
Lm2[-1][0]

```

Is there a way to do this using something similar to slice notation that will work in both cases (when index is list and when index is not list) or a simple one liner?

Something like:

```
#Lm1[-1:][:]...

```

The problem is that I don't know if its more time eficient to just build the list 
 like Option2 and use the same slice notation or to use the if cause everytime like Option1.

I'm using pythom 3.7, don't know much about older versions.