def lines(a, b):
    """Return lines in both a and b"""

    same_lines = []

    # creating a list with all the lines in file1
    linesA = a.split("\n")
    linesA = [i.rstrip("\r") for i in linesA]

    # creating a list with all the lines in file2
    linesB = b.split("\n")
    linesB = [i.rstrip("\r") for i in linesB]

    for line in linesA:
        if line in linesB and line not in same_lines:
            same_lines.append(line)

    return same_lines