# Third Practicum: Tuesday, December 11th

## 8:00 a.m. - 9:50 a.m. in Linfield 301

• The practicum will allow you to demonstrate your ability to use Python to solve problems. The assignments to date should help reinforce your understanding of the material.
• The practicum is comprehensive.
• One question will require you to understand recursion. Here are several practice problems.
• At least one question will require you to understand strings.
• At least one question will require you to understand the more about iteration unit.
• You may bring one 8.5 inch by 11 inch sheet of double-sided notes.
• You may bring a laptop to develop your answers. You may only use the internet to access the interactive Python textbook, the online Python documentation or previous Python programs that you (or you and your partner) wrote for this course.
• To be successful on the exam, strive to understand the Python material and be able to use it to solve small problems.

## Final's Week Office Hours

• Monday from 3:10 p.m. - 5:00 p.m. in Barnard Hall 353

## Practice Practicum Problems

### Question 1

Conduct experiments with the Python code below until you can describe in simple English what is true of the variable answer after the while loop finishes.

```answer = ""
```

### Question 2

Modify the recursive function below so that same size, smaller squares are drawn in both the upper left hand and lower right hand corners of larger squares.

```import turtle

def square(aTurtle, upperX, upperY, width):
aTurtle.up()
aTurtle.goto(upperX, upperY)
aTurtle.down()
for side in range(4):
aTurtle.forward(width)
aTurtle.right(90)

def recursive_squares(aTurtle, upperX, upperY, width, level):
if (level > 0):
square(aTurtle, upperX, upperY, width)
recursive_squares(aTurtle, upperX, upperY, width / 3, level - 1)

squares = turtle.Turtle()
squares.color("blue")
recursive_squares(squares, -200, 200, 400, 3)
squares.hideturtle()
```

### Question 3

Write a function named eliminate_consonants that strips out all consonants from the word that it is given. For example, if eliminate_consonants is called with "mississippi", it should return "iiii".

```result = eliminate_consonants("mississippi")
print(result)     # should print "iiii"
```

### Question 4

A year is a leap year if it is divisible by 4 unless it is a century that is not divisible by 400. Write a function that takes a year as a parameter and returns True if the year is a leap year, False otherwise.