Advertisement
stefano_p

permut_prova

May 25th, 2015
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. # LA FUNZIONE Può ESSRE CHIAMATA ANCHE CON UN SOLO PARAMETRO ES. ==>
  2. #   permut_prova('ABC')
  3.  
  4.  
  5. def permut_prova(stringA,stringB=''):
  6.  
  7.   if len(stringA)>=8:
  8.     showInformation('stringa troppa lunga')           #il mio pc dopo len(stringA) > di 8 perde colpi !!
  9.   if len (stringA)==0:
  10.     print stringB
  11.    
  12.   else :
  13.     for i in range(0,len(stringA)):
  14.    
  15.       permutprova(stringA[0:i]+stringA[i+1:],stringB+stringA[i])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement