rishabbansal21

_/\_

Sep 8th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. import random
  2.  
  3. opt = input()
  4.  
  5. opt = opt.split(" ")
  6.  
  7. def st(n):
  8. i = 0
  9. s = "AaB1C{DbE2FcG3HdI4JeK5LfM6NgO7PhQ8RiS9TjU0VkW-XlY[Zma]bnn\dor'yp7;6q4,srl.p<0s-/+t>!)?u@:v#w$x(%}y^|z&"
  10.  
  11. while len(s) != n:
  12. s += r(i)
  13. i +=1
  14. return s
  15.  
  16. def r(i):
  17. s = "AaB1C{DbE2FcG3HdI4JeK5LfM6NgO7PhQ8RiS9TjU0VkW-XlY[Zma]bnn\dor'yp7;6q4,srl.p<0s-/+t>!)?u@:v#w$x(%}y^|z&"
  18. random.seed(i)
  19. t = random.randint(1,101)
  20. return s[t]
  21.  
  22. def enter_substring(st,original):
  23. l = len(st)
  24. f = 0
  25. for i in range(len(original)):
  26. l_count = 0
  27. if st[0] == original[i]:
  28. for j in range(len(st)):
  29. if st[j] == original[i+j]:
  30. l_count += 1
  31.  
  32. if l_count == l:
  33. print("offset = ",i+1)
  34. f = 1
  35.  
  36. if f == 0:
  37. print("wrong substring entered!")
  38.  
  39. if int(opt[0]) == 1 and int(opt[1])<102:
  40. s = "AaB1C{DbE2FcG3HdI4JeK5LfM6NgO7PhQ8RiS9TjU0VkW-XlY[Zma]bnn\dor'yp7;6q4,srl.p<0s-/+t>!)?u@:v#w$x(%}y^|z&"
  41. print(s[:int(opt[1])])
  42.  
  43. if int(opt[0]) == 1 and int(opt[1])>=102:
  44. print(st(int(opt[1])))
  45.  
  46. if int(opt[0]) == 2:
  47. original = st(20280)
  48.  
  49. enter_substring(str(opt[1]),original)
Add Comment
Please, Sign In to add comment