In this task, you are given inputs i and A, where i is an integer and A is a list. You need to list all the elements of A preceding the last i elements. i will always have a value less than the length of A.
4, ['501', 'K', '3887', 'P', '7837', '9603', '6857', '2945', '33', '8183', 'n', 'c', 'M', '5847', 'o', '2023', '9107', 'x']