In list1.py use word[-1] to get last element.
In list1.py implement sort_last()