I made the suggested changes, and get no errors (that I can tell), but the last part of the code does not do what I want it to, which is to read the file I just wrote to, and print out what was read (there should be 80 rows of three variables/values per row). With the code I have, I assumed the print statement would execute each time the file was read, ie, read a row, print it, read a row, print it, etc. (nothing prints out)
f = open("test.txt", "w") yourstartage = 62 herstartage = 61 startyear = 2017 for y in range(81): f.write('{}{}{}\n'.format(startyear, yourstartage, herstartage)) yourstartage += 1 herstartage += 1 startyear += 1 with open("test.txt", "r") as opened_file: for line in opened_file: startyear, yourstartage, herstartage = line.split() print(startyear, yourstartage, herstartage)I looked on the forum site to find how to do code tags but could not find reference. sorry. thanks for all of your help - no more questions today