def nP(n, k=None, replacement=False):
 try:
  n = as_int(n)
 except ValueError:
  return Integer(_nP(_multiset_histogram(n), k, replacement))
 return Integer(_nP(n, k, replacement))

def nP ( n , k = None , replacement = False ) : try : n = as_int ( n ) except ValueError : return Integer ( _nP ( _multiset_histogram ( n ) , k , replacement ) ) return Integer ( _nP ( n , k , replacement ) )
return the number of permutations of n items taken k at a time .