Advertisement
Guest User

best277777788888899

a guest
Apr 26th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. def produit_chiffres(N):
  2.     N=str(N)
  3.     L=len(N)
  4.     produit=1
  5.    
  6.     for i in range(L):
  7.         x=int(N[i])
  8.         produit*=x
  9.     N=str(produit)
  10.     compteur=1
  11.     while len(N)>1:
  12.         N=str(N)
  13.         L=len(N)
  14.         produit=1
  15.         for i in range(L):
  16.             x=int(N[i])
  17.             produit*=x
  18.         N=str(produit)
  19.         compteur+=1
  20.     return compteur,N
  21.  
  22. N=277777788888899  
  23.  
  24. for i in range(100):
  25.     N+=1
  26.     etapes=produit_chiffres(N)[0]
  27.     valeur_finale=produit_chiffres(N)[1]
  28.     print(etapes,N)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement