def symmetric(n):
 for perm in variations(list(range(n)), n):
  (yield Permutation(perm))

def symmetric ( n ) : for perm in variations ( list ( range ( n ) ) , n ) : ( yield Permutation ( perm ) )
generates the symmetric group of order n .