Advertisement
Guest User

Untitled

a guest
Nov 25th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.81 KB | None | 0 0
  1. def histoListApp(text):
  2.     txt=list(text)
  3.     HLA=[]
  4.     for lettre in txt:
  5.         if lettre not in HLA:
  6.             HLA.append(lettre)
  7.             HLA.append(text.count(lettre))
  8.     return HLA
  9.  
  10. def histoListLex(text):
  11.     provisoir=[]
  12.     for i in range(0,len(histoListApp(text)),2):
  13.         provisoir.append((histoListApp(text))[i])
  14.     provisoir=sorted(provisoir)
  15.     HLL=[]
  16.     for j in provisoir:
  17.         HLL.append(j)
  18.         b=text.count(j)
  19.         HLL.append(b)
  20.     return HLL
  21.    
  22.    
  23. def histoDico(text):
  24.     HD={}
  25.     for i in text:
  26.         if i in HD:
  27.             HD[i]+=1
  28.         else:
  29.             HD[i]=1
  30.     return sorted(list(HD.items()))
  31.  
  32.  
  33. def permutations5(text) :
  34.     Mrot=[""for i in range(len(text))]
  35.     for i in range(len(text)):
  36.         Mrot[i]=text[-i:]+text[:-i]
  37.     return Mrot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement