Answer:
The answer is the programming in Python language has strings and characters that has to be declared in the method.
Explanation:
#method
def hasFinalLetter(strList,letters):
output = #output list
#for every string in the strList
for string in strList:
#findout the length of each string in strList
length = len(string)
#endLetter is last letter in each string
endLetter = string[length-1]
#for each letter in the letters list
for letter in letters:
#compare with endLetter
#if we found any such string
#add it to output list
if(letter == endLetter):
output.append(string)
#return the output list
return output
#TestCase 1 that will lead to return empty list
strList1 = ["user","expert","login","compile","Execute","stock"]
letters1 = ["a","b","y"]
print hasFinalLetter(strList1,letters1)
#TestCse2
strList2 = ["user","expert","login","compile","Execute","stock"]
letters2 = ["g","t","y"]
print hasFinalLetter(strList2,letters2)
#TestCase3
strList3 = ["user","expert","login","compile","Execute","stock"]
letters3 = ["k","e","n","t"]
print hasFinalLetter(strList3,letters3)