Sep-15-2017, 10:59 PM
As I said, lines are read in from files as strings. The readlines method gives you a list of strings. You were looping over them in appendFile before, that was fine, and was giving you individual strings. As I said, you need to convert those to integers using int().
>>> text = '1984' # a string >>> leapYear(text) # this will give a TypeError >>> leapYear(int(text)) # this will work
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