# Honeypot Case Study, Functions

In the last chapter, we performed a complete work-through of the honeypot case study. This is fine, but we just wrote a script that progressed step-by-step. There ere a couple areas where we could have recycled code by writing functions. 

```{exercise, name="Code review"}
Review your solution from the honeypot case study. Can you identify areas where we reused code that we would rather define as a function? 
```


```{exercise, name="Creating functions"}
Create a new text file and generalize your code to use functions where possible instead of straight-forward imperative programming that we have done thus far. You should have two new functions: `def get_data(x, type)` and `get_indexes(type)`
```
