def get_data(filename):
    """
    From data file, reads, formats and saves data as a list.
    Args:
        filename: the name of a data file such as data.txt.
    Returns:
        lines: a list of formatted and relevant data items extracted from the data file.
    """  
    f = open(filename, 'r')
    lines = f.read().splitlines() # Reads, formats and saves data as a list.
    f.close()
    lines = [x.strip() for x in lines if x.strip()] #Removes empty list items.
    
    return lines