Guest User

Untitled

a guest
May 25th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #Determines location of Motif in Sequence
  2. f = open("FindMotifDNAinput.txt", "r");
  3. s = str(f.readline().strip()); #strip is essential to avoid breaking too soon
  4. t = str(f.readline().strip());
  5. f.close();
  6. res = "";
  7. i = -1;
  8. while True:
  9. i = s.find(t, i+1);
  10. if i == -1: break;
  11. res += str(i+1) +" "; #i+1 is to change from 0-based numbering to 1-based
  12. print res;
Add Comment
Please, Sign In to add comment