Solution 1

``````def insert_human(a_list, position, elem):
if position == 'first':
index = 0
elif position == 'second':
index = 1
elif position == 'third':
index = 2
elif position == 'last':
index = len(a_list)

a_list.insert(index, elem)
``````

# First - Second - Third - Last

The function `insert_human` receives a list, a position and an element to insert (similar to the `insert` method). The difference is that the position is specified in a "human" manner. Examples:

``````list_1 = ['a', 'b', 'c']

insert_human(list_1, 'first', 'Z')
print(list_1)  # ['Z', 'a', 'b', 'c']

list_2 = ['a', 'b', 'c']

insert_human(list_2, 'second', 'Z')
print(list_2)  # ['a', 'Z','b', 'c']

list_3 = ['a', 'b', 'c']

insert_human(list_3, 'last', 'Z')
print(list_3)  # ['a','b', 'c', 'Z']
``````

### Test Cases

test second position -

``````def test_second_position():
list_1 = ['a', 'b', 'c']

insert_human(list_1, 'second', 'X')
assert list_1 == ['a', 'X', 'b', 'c']
``````

test last position -

``````def test_last_position():
list_1 = ['a', 'b', 'c']

insert_human(list_1, 'last', 'X')
assert list_1 == ['a', 'b', 'c', 'X']
``````

test third position -

``````def test_third_position():
list_1 = ['a', 'b', 'c']

insert_human(list_1, 'third', 'X')
assert list_1 == ['a', 'b', 'X', 'c']
``````

test first position -

``````def test_first_position():
list_1 = ['a', 'b', 'c']

insert_human(list_1, 'first', 'X')
assert list_1 == ['X', 'a', 'b', 'c']
``````
def insert_human(a_list, position, elem): pass