I am new to this forum and python, as you will discover. I am trying to learn how to write variables to a file that I can later read back. My code is below -- sorry, I do not know how to do 'code tags' (I will learn).
I need to know what is wrong with the statement "f.write (startyear, yourstartage, herstartage). I am using PyCharm text editor, and to no really know how to use it either, so please bear with me.
I need to know what is wrong with the statement "f.write (startyear, yourstartage, herstartage). I am using PyCharm text editor, and to no really know how to use it either, so please bear with me.
yourstartage = 62 herstartage = 61 startyear = 2017 print("Year", "Your", "Her") print("\t ", "Age", "Age") for i in range(81): print(startyear, yourstartage, herstartage) yourstartage += 1 herstartage += 1 startyear += 1 f = open("test.txt", "wb") for y in range(81): f.write(startyear,yourstartage,herstartage) yourstartage += 1 herstartage += 1 startyear += 1 f.close()thanks for looking