Natalie and Kit's regex exercises

by Natalie Le and Kit Krueger

02 Apr 2016

Exercise 1: Kit: This exercise was a good combination of old and new skills. The counting loop was familiar; it just needed to be combined with the re.search command from Chapter 11.

Exercise 2: Natalie: Wow I dont know why the second part of this semester tripped me up so much. I feel like I dont have a good foundation on how the syntax works and what class types it returns. Like there’re 2 ways to read files, the one from the text and the one you showed in class. But they seem to import files into different types: string versus list or sth. And then when we read the lines, they all turn into list? But on some examples they remain as strings? So for this exercise, I’m just really confused with all the types. The numbers I was able to extract remain as list no matter what I tried to convert them. Failed.

Exercise 3: Remembering to convert strings to integers still takes a few attempts. We drew the general idea for this from last week’s exercises; we had some trouble before figuring out how to search specific items instead of whole lists, but it went quickly after we added the cells variable.

Natalie is a first year MSPH student at the Gillings School of Public Health. Find Natalie Le on Twitter, Github, and on the web.
Kit is an LS student who enjoys academic libraries as well as holding coats and snickering. Find Kit Krueger on Twitter, Github, and on the web.