import math for N in range(1,5) : for O in range(0,10) : NON = 100*N + 10*O + N OUI = NON+NON centaines = math.floor (OUI/100) # chiffre des centaines de OUI U = math.floor ((OUI-100*O)/10) # chiffre des dizaines de OUI I = OUI %10 # chiffre des unités de OUI if (centaines==O) and (N!=O) and (N!=I) and (I!=O) and (U!=N) and (U!=I) and (U!=O) : print(NON,OUI)