As part of my assignment I'm trying to write a program that reads a text file and unifies all the words in that text file together. I made the code so far but it is not working for me and I do not know how else to proceed. What am I missing?
def problem2(filename):
func = open(filename, 'r')
string = ''
for line in func:
string += line
func.close()
return string
print(problem2("lol.txt"))