I'm not a great coder, but reading SICP def upped my game. After working through the first few chapters, I've rarely defined a function that depends on the program's state (a given input produces the same output everytime).
I need to dig into Python's functional tools more, but I do love me some list comprehensions.
writing this quick to GetItWorking (TM), but feels really inelegant, any suggestions?
Code:
for line in page_content.split('\n'):
line = line.strip()
if len(line) and len(line.split(',') == 2) and line.split(',')[0].strip() in anchor_data:
anchor_data[line.split(',')[0].strip()] = int(line.split(',')[1])