Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rep_str="bbaaa"
- k=3
- found = False
- tmp = rep_str[0]*k
- for i in range(len(rep_str)):
- if tmp in rep_str:
- found = True
- print "The first substring of length " + str(k) +" is "+ str(tmp) +"!"
- break
- tmp = rep_str[i]*k
- if not found:
- print "nothing found for the string " + str(rep_str) +"!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement