I am having trouble to why I am getting this error. I would like to have any assistance with this issue.
happyList = []
sadList = []
exclude = string.punctuation
happy_file = open("happy.txt", "r")
for word in happy_file:
word = ''.join(ch for ch in word if ch not in exclude)
happyList.append(word.strip().lower())
happy_file.close()
The error:
happyList.append(word.strip().lower())
^
SyntaxError: invalid syntax