Gustavo-Augusto

trabalho1

Jan 4th, 2014
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. def leArquivo(entrada):
  2.     a = open(entrada,'r');
  3.     aux = a.read();
  4.     separado = separaLetras(aux);
  5.     separado = separado.split(',');
  6.     tam = len(separado);
  7.     k = input ("Informe o tamanho das substrings: ")
  8.     if(k>tam):
  9.         print "O tamanho das substrings e maior que o tamanho da lista."
  10.     else:
  11.         return Kmer(separado,k);
  12.  
  13. def separaLetras(texto):
  14.     if not texto:
  15.         return texto;
  16.     else:
  17.         aux = separaLetras(texto[1:]);
  18.         if not aux:
  19.             return texto[0];
  20.         else:
  21.             return texto[0] + ',' + aux;
Advertisement
Add Comment
Please, Sign In to add comment