This is a little shorter most of our prelabs.
Work out by hand what the following function will do. If you want to check your answer by typing the function into Python, that is fine, but you need to be able to think about recursive functions without running them. Start by computing strange(0), then strange(1), strange(2), and so forth.
def strange(x) : if x <= 0 : return 1 else : return 5 * strange(x-1) - 2
You will need this for one of the recursive pictures. Consider the following figure.
Let (Ax, Ay) be the coordinates of point A, (Bx, By) those of point B, and (Cx, Cy) those of point C. The points P, Q and R are the midpoints of the three edges of the big triangle.
3) Write a recursive function noSpace( s ) that takes string s and returns a string like s with all of the spaces removed. So noSpace( "Bob Geitz" ) returns "BobGeitz" and noSpace( "A B C D" ) returns "ABCD". When you recurse you break the string into 2 parts: s[0[ is the first letter of s, and s[1:] is all of x except for the first letter.
If you followed the Honor Code in this assignment, write the following sentence attesting to the fact at the top of your homework.
I affirm that I have adhered to the Honor Code in this assignment.