Read the comments in this example code, it should show you how to solve your problem.
# data string for testing
data = """\
line one
line two
line three"""
# data list for testing
listOfLines = data.split('\n')
listofWordsinLines = []
for line in listOfLines:
# words is a list
words = line.split()
# extend this list
listofWordsinLines.extend(words)
print(listofWordsinLines)
# change list to a set
setofWordsinLines = set(listofWordsinLines)
print(setofWordsinLines)
"""my console display -->
['line', 'one', 'line', 'two', 'line', 'three']
{'line', 'three', 'two', 'one'}
"""
Also, variable names starting with an upper case letter are customarily used for class names.