Advertisement
TShiva

Untitled

May 25th, 2017
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. def cock(s):
  2.     smart_len=0
  3.     for j in range(len(s)):
  4.         start=j
  5.         cock_string = ''
  6.         for i in range(start,len(s)):
  7.             cock_string+=s[i]
  8.             if cock_string in s[i:start-1:-1]:
  9.                 if smart_len <= len(cock_string):
  10.                     smart_len=len(cock_string)
  11.                     print('start', start)
  12.                     print('cock_string:',cock_string)
  13.                     print(smart_len)
  14.                     print(s[i:-start:-1])
  15.                     print('-------')
  16.     print(smart_len)
  17.  
  18.  
  19. def main():
  20.     s='aa'
  21.     print(s)
  22.     cock(s)
  23.  
  24. if __name__ == "__main__":
  25.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement