Grouping a list by their last element
docstring

Your original method is adequately docmented, but you can format your docstring also according to a general style. This SO answer covers some of the templates.

doctest

If you format your example in the correct way, you can use doctest to test it. This format is also recognised by Sphinx and other documentation tools, 

alternative approach

Another approach would be to use a collections.defaultdict(list)

def match_ends(list1):
    result = defaultdict(list)
    for item in list1:
        result[item[-1]].append(item)
    return result


This way you don't have to sort the list first, but need to append to it. If you use python >3.6, the original method will also return a alphabetically sorted dict, while this method will be sorted along the occurrence in the original list.