Question: You will code the following functions in the programming language Python. For help with the syntax you will need to complete the code, please read

You will code the following functions in the programming language Python. For help with
the syntax you will need to complete the code, please read the document "Code Help" that
is included with this assignment. Turn in your assignment as a PDF file.
You can call this function whatever you want, but I'll call it bit'ToTy. The input will
be a bit string, which we will represent as a list of 0's and 1's. Your function will
interpret each 0 as a tree and each 1 as a fence in our "trees and yards" problem. The
output of your function will be a list, where each component is the number of trees
in a particular yard. For instance, if our bit string is 0010100010, then we have four
yards (since we have three fences, one for each 1 in the bit string). The first yard has
two trees (two 0's); the second yard has one tree; the third yard has three tress; and
the fourth yard has one tree. Thus, if the input to the function bitToTy is the list
0,0,1,0,1,0,0,0,1,0, then the output will be the list 2,1,3,1.
Remember that if you have a 1 on either end, that indicates a yard with no trees in it.
So if you have the input 1,0,0,1,0,1, the output will be 0,2,1,0.
Now let's try a function that I'll call ty'ToBit. The input will be a list, where each
component is the number of trees in that particular yard. The input will be the bit
string that corresponds to the distribution of trees, where "1" is a fence and "0" is a
tree. For instance, if your input is 2,1,0,3, your output will be 001011000.
Make sure your functions are well documented. You should have one-line comments (using
the single line comments with #) written in complete sentences that describe what cach line
of code does. You may not import any packages to help you wilh your function.
 You will code the following functions in the programming language Python.

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!