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 17:30
Under which key category do the page up and page down keys fall? page up and page down keys fall under the keys category.
Answers: 1
question
Computers and Technology, 22.06.2019 19:30
When using a public computer or network, you should always
Answers: 2
question
Computers and Technology, 22.06.2019 22:00
Consider the following declarations (1, 2, 3, 5, 7)class bagtype{public: void set(string, double, double, double, double); void print() const; string getstyle() const; double getprice() const; void get(double, double, double, double); bagtype(); bagtype(string, double, double, double, double); private: string style: double l; double w; double h; double price; }; a.) write the definition of the number function set so that private members are set according to the parametersb.) write the definition of the member function print that prints the values of the data membersc.) write the definition of the default constructor of the class bagtype so that the private member variables are initialized to "", 0.0, 0.0, 0.0, 0.0, respectively d.) write a c++ statement that prints the value of the object newbag.e.) write a c++ statement that declares the object tempbag of type bagtype, and initialize the member variables of tempbag to "backpack", 15, 8, 20 and 49.99, respectively
Answers: 3
question
Computers and Technology, 23.06.2019 18:50
Ais a picture icon that is a direct link to a file or folder
Answers: 1
You know the right answer?
PYTHON 1.
a. Write a function named hasFinalLetter that takes two parameters
1. strLis...
Questions
question
Mathematics, 26.06.2019 09:00
Questions on the website: 13722367