daily pastebin goal
50%
SHARE
TWEET

Untitled

a guest Sep 14th, 2018 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. #paquet("ABCD", 2)={0:1, 1:203}
  3. #Code erreur : dico vide
  4. def paquet(txt, paq=1) :
  5.     try :
  6.         txt=str(txt)
  7.         paq=int(paq)
  8.     except : return dict()
  9.     if(paq<0) : return dict()
  10.    
  11.     res=dict()
  12.     n=len(txt)
  13.     i=0
  14.     nb_paq=-1
  15.     while(i<n) :
  16.         if(i%paq==0) :
  17.             nb_paq+=1
  18.             res[nb_paq]=0
  19.         res[nb_paq]=res[nb_paq]*100+codex(txt[i])
  20.         i+=1
  21.    
  22.     while(i%paq!=0) :
  23.         res[nb_paq]*=100
  24.         i+=1
  25.     return res
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top