def merge(l1, l2):
    """Merge two sorted lists."""
    d = {'test': 'test'}

    i = 0 
    j = 0

    lmerged = []

    while (i <= len(l1) - 1) or (j <= len(l2) - 1):
        if i == len(l1):
            lmerged.extend(l2[j:])
            break
        if j == len(l2):
            lmerged.extend(l1[i:])
            break
        if (i < len(l1)) and (l1[i] < l2[j]):
            lmerged.append(l1[i])
            i += 1
        else:
            lmerged.append(l2[j])
            j += 1
    
    return lmerged