Tuple no attribute error - Python Forum
python-forum.io › thread-13250Here line is a tuple (index, item), so you can't use split on it, which is a method of string type. You could instead unpack the tuple into two variables like this: for index, line in enumerate(yrs_file): Then line will be a string which you can split. You could also access only the second element of the tuple - the string you want to split: