def merge(a, b):
    if len(a) * len(b) == 0:
        return a + b

    v = (a[0] < b[0] and a or b).pop(0)
    return [v] + merge(a, b)


def mergesort(list):
    if len(list) < 2:
        return list

    m = len(list) / 2
    return merge(mergesort(list[:m]), mergesort(list[m:]))

def merge(a, b):
    if len(a) * len(b) == 0:
        return a + b

    v = (a[0] < b[0] and a or b).pop(0)
    return [v] + merge(a, b)


def mergesort(list):
    if len(list) < 2:
        return list

    m = len(list) / 2
    return merge(mergesort(list[:int(m)]), mergesort(list[int(m):]))

Fix slices for Python 3
Fix slices for Python 3

  def merge(a, b):
      if len(a) * len(b) == 0:
          return a + b
  
      v = (a[0] < b[0] and a or b).pop(0)
      return [v] + merge(a, b)
  
  
  def mergesort(list):
      if len(list) < 2:
          return list
  
      m = len(list) / 2
-     return merge(mergesort(list[:m]), mergesort(list[m:]))
+     return merge(mergesort(list[:int(m)]), mergesort(list[int(m):]))
  
Fix slices for Python 3
## Code Before:
def merge(a, b):
    if len(a) * len(b) == 0:
        return a + b

    v = (a[0] < b[0] and a or b).pop(0)
    return [v] + merge(a, b)


def mergesort(list):
    if len(list) < 2:
        return list

    m = len(list) / 2
    return merge(mergesort(list[:m]), mergesort(list[m:]))

## Instruction:
Fix slices for Python 3
## Code After:
def merge(a, b):
    if len(a) * len(b) == 0:
        return a + b

    v = (a[0] < b[0] and a or b).pop(0)
    return [v] + merge(a, b)


def mergesort(list):
    if len(list) < 2:
        return list

    m = len(list) / 2
    return merge(mergesort(list[:int(m)]), mergesort(list[int(m):]))
