subject

PYTHON 1.
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.
2.
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.
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.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:00
Which of the following physical laws can make the flow of water seem more realistic? a. motion b. gravity c. fluid dynamics d. thermodynamics
Answers: 2
question
Computers and Technology, 22.06.2019 19:50
Write a car class having two private member variables called tank and speed. write public methods called pumpgas and gofast. the method pumpgas gets an integer for gas that must be pumped. that value needs to be added to tank (no more than 20 gallons). it must return the amount of gas that is purchased ($4 per gallon). the method gofast should increase the speed by 5 each time it is called.write a constructor for the above class that initialized both variables to zero.write a tostring to display both the tank and speed when the car is printed.modify the car class to implement the interface comparable and an interface called carinter having the public methods in carinter.write the main program to create an array of size 5 of type car. create 5 car objects having each location of the array to refer to one of the cars. test the pumpgas, gofast, equals method on the array items. write an enhanced loop to print all the car values (using a tostring written last time).write a generic method to find the minimum of four items. pass int, double, char, string and car objects to test this method.
Answers: 1
question
Computers and Technology, 23.06.2019 22:20
Read “suburban homes construction project” at the end of chapters 8 and 9 (in the textbook) and then develop a wbs (work breakdown structure) in microsoft excel or in microsoft word (using tables)
Answers: 1
question
Computers and Technology, 24.06.2019 07:00
Into what form does the barcode reader convert individual bar patterns?
Answers: 1
You know the right answer?
PYTHON 1.
a. Write a function named hasFinalLetter that takes two parameters
1. strLis...
Questions
question
Mathematics, 13.10.2020 05:01
question
Mathematics, 13.10.2020 05:01
question
Social Studies, 13.10.2020 05:01
question
Social Studies, 13.10.2020 05:01
question
Geography, 13.10.2020 05:01
Questions on the website: 13722367