Question: Question 1: a.Write a function named hasFinalLetterthat takes two parameters 1.strList, a list of non-empty strings 2.letters, a string of upper and/or lower case letters

Question 1:

a.Write a function named hasFinalLetterthat takes two parameters

1.strList, a list of non-empty strings

2.letters, a string of upper and/or lower case letters

The function hasFinalLettershould 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.

Question 2:

a.Write a function named isDivisible that takes two parameters

1.maxInt, an integer

2.twoInts, a tuple of two integers

The function isDivisibleshould create and return a list of all the ints in the range from 1 to maxInt(not including maxInt) that are divisible of both ints in twoInts.

b.Create three test cases, each consisting of a value for maxIntand a value for twoInts, for your function in Problem 2a. 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.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!