Question: Problem Notes Come back to these after you have read through the problems . You should write tests for all of the functions you write

 Problem Notes Come back to these after you have read through

Problem

the problems . You should write tests for all of the functions

Notes Come back to these after you have read through the problems . You should write tests for all of the functions you write for this lab. Write the tests before you write the code, and put them after the if --name-- == '-_main__': line. We're going to import the functions from your files for testing and, if you don't put your tests after this line and indented to the if block), then it might confuse our testing code. Also, this if good programming practice. Yes, we (more or less) wrote the sum functions in class last week. There are a number of ways to write the recursive functions. Any of them will do. There are likely to be built-in functions for a number of the things we're asking you to do for this lab. Please don't use them. If you do, you'll get zero points for that part of the assignment, since we want you to write them from scratch (this time). The amplitude filter only affects sensor readings beyond a certain threshold. These sensor readings get clipped to the maximum allowed amplitude. When you write the variable-width mean filter, you might find array slicing useful. Also, the filtered arrays will be shorter than the input arrays. For a filter with width 3, the filtered lists will be 2 elements shorter than the original list. For a width of 5, it will be 4 shorter, and so on. Make sure you write testing code for all of the functions that you write. In a new file reverse.py, write two functions, one recursive and the other iterative, that take in a list and return a new list with the elements in reverse order. These functions should be called reverse_r and reverse_i respectively. Note that if you Google for how to reverse something, you will likely find some answers about list slicing like [::-1). For this problem, we want you not to use this. Write some test code to test your two reverse functions out. Input/Output Examples: reverse_i(['h', 'e', 'l', 'l', 'd']) returns ['o', 'l', 'l', 'e', 'h'] reverse_r('h', 'e', 'l', 'l', 'd']) returns ['o', 'l', 'l', 'e', 'h'] reverse_i([1, 2, 3, 4, 5]) returns (5, 4, 3, 2, 1]

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!