def issorted(seq):
 if (not seq):
  return True
 x = seq[0]
 for elem in seq[1:]:
  if (elem < x):
   return False
  x = elem
 return True

def issorted ( seq ) : if ( not seq ) : return True x = seq [ 0 ] for elem in seq [ 1 : ] : if ( elem < x ) : return False x = elem return True
is sequence sorted? .