def import_words(filename):
    """Imports words from a given .txt file and returns it.
    """

    # Initialize resuts variable
    results = []

    # This with statement ensures the file is only open for a certain amount of time.
    # This can save RAM and processing speeds in larger projects
    # Rename the sprits.txt as inputfile within this with statement
    with open(filename,"r",encoding = "utf-8") as inputfile:

        # Loop through each line in the defined inputfile variable
        for line in inputfile:
            # Create a new list from each line, and split it at each space " "
            for word in line.strip().split(" "):
                # Individually append every word to the results variable
                results.append(word)
    return(results)