def sublist_reverse(lst, a, b):
 while (b > a):
  (lst[a], lst[b]) = (lst[b], lst[a])
  b -= 1
  a += 1

def sublist_reverse ( lst , a , b ) : while ( b > a ) : ( lst [ a ] , lst [ b ] ) = ( lst [ b ] , lst [ a ] ) b -= 1 a += 1
reverses the elements lst[a:b] .