from math import factorial mot = input("Entrez un mot : ") n = len(mot) L = [] P = 1 for lettre in mot: c = ( lettre , mot.count(lettre) ) if c not in L: L.append(c) P *= factorial(c[1]) N = int(factorial(n) / P) print("Le nombre d'anagrammes de",mot," est égal à",N, end=".") Prepamath downloader

Prépamath

Downloading...