a. Write a function named hasFinalLetter that takes two parameters

1. strList, a list of non-empty strings
2. letters, a string of upper and/or lower case letters
The function hasFinalLetter should create and return a list of all the strings in strList that end
with a letter in letters.
b. Create three test cases, each consisting of a list of non-empty strings and a string of upper
and/or lower case letters, for your function in Problem 1a. One of these tests should return
the empty list. For each test case write two assignment statements and a function call that
pass the test arguments to your function.
Anyone know how to do this I keep getting invalid syntaxes?

Sure! I can help you with that. Here's the solution to problem 1a:

```python
def hasFinalLetter(strList, letters):
result = []
for string in strList:
if string[-1] in letters:
result.append(string)
return result
```

Explanation:
- The function `hasFinalLetter` takes two parameters: `strList` (a list of non-empty strings) and `letters` (a string of upper and/or lower case letters).
- Inside the function, we define an empty list called `result` to store the final strings.
- We then loop through each string in `strList` using a for loop.
- For each string, we check if the last character (`[-1]` index) exists in the `letters` string. If it does, we append that string to the `result` list.
- After looping through all the strings, we return the `result` list.

Now, let's create three test cases (as requested):

```python
# Test case 1: Non-empty strings with letters 'a' and 'b'
strings1 = ['apple', 'banana', 'orange']
letters1 = 'ab'
result1 = hasFinalLetter(strings1, letters1)
print(result1) # Output: ['banana']

# Test case 2: Non-empty strings with letters 'o' and 'y'
strings2 = ['hello', 'goodbye', 'okay']
letters2 = 'oy'
result2 = hasFinalLetter(strings2, letters2)
print(result2) # Output: ['hello', 'okay']

# Test case 3: Non-empty strings with letters 'xyz'
strings3 = ['python', 'programming', 'explanation']
letters3 = 'xyz'
result3 = hasFinalLetter(strings3, letters3)
print(result3) # Output: []
```

I hope this helps! Let me know if you have any further questions.