Sep-17-2017, 01:27 AM
split would have cleared out the white space. This includes the return character at the end of the line. Since you didn't use it, you need to use strip before isdigit: line.strip().isdigit(). It's including the last line because there is no return character at the end of the file.
If you are not allowed to use the split() method, getting the years out of the other text is going to be a pain. Can you confirm that?
I guess you could do
If you are not allowed to use the split() method, getting the years out of the other text is going to be a pain. Can you confirm that?
I guess you could do
line[:5].strip()
to clear out the other text.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures