Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- line_ap = lines[find_substr_in_lines(lines, "AP (")]
- parse_ap(line_ap, row)
- #parse number of ap courses
- def parse_ap(line, row):
- regex = re.compile(r'\((\d+)\)')
- regMatch = regex.findall(line)
- commas = line.count(",")
- if len(regMatch) > 0 and len(regMatch) > commas:
- row.append(str(len(regMatch)))
- elif line.find(","):
- line = line.split(";")
- result = 0
- for section in line:
- section = section.split(",")
- result += len(section)
- row.append(str(result))
- else:
- row.append("none")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement