Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

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

image text in transcribed

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, eg.: >>> hasFinalLetter ( ["cat", "frog", "turtle"], "ekGaBt") ['cat', 'turtle'] 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 la. 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. a. Write a function named isDivisible that takes two parameters 1. maxInt, an integer 2. twoInts, a tuple of two integers The function isDivisible should 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, e.g.: >>> isDivisible (100, (2, 5)) [10, 20, 30, 40, 50, 60, 70, 80, 90] b. Create three test cases, each consisting of a value for maxInt and 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

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students explore these related Databases questions