Advertisement
Guest User

Num 5

a guest
Mar 30th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. rep_str="bbaaa"
  2. k=3
  3. found = False
  4. tmp = rep_str[0]*k
  5. for i in range(len(rep_str)):
  6. if tmp in rep_str:
  7. found = True
  8. print "The first substring of length " + str(k) +" is "+ str(tmp) +"!"
  9. break
  10. tmp = rep_str[i]*k
  11.  
  12. if not found:
  13. print "nothing found for the string " + str(rep_str) +"!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement