I am reading a number from a text file and trying to convert it into an int but it keeps giving me errors. This is my code:
f = open('commentcount.txt', 'r')
counts = f.readline()
int(counts)
counts = counts + 1
print(counts)
I am getting this error:
counts = counts + 1
TypeError: Can't convert 'int' object to str implicitly
What am I doing wrong?