kolay_ne

RSAlice source

May 21st, 2021 (edited)
866
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. from random import randint
  2.  
  3.  
  4. with open("alice_in_wonderland_modified.txt", "r") as f:
  5.     text = f.read()
  6.  
  7.  
  8. flag = '***********'
  9. rid = randint(0, len(text) - 1)
  10. text = text[:rid] + flag + text[rid:]
  11.  
  12.  
  13. new_text = ''
  14. l = 0
  15. r = len(text) - 1
  16. while l <= r:
  17.     new_text += text[l]
  18.     l += 1
  19.     if l <= r:
  20.         new_text += text[r]
  21.         r -= 1
  22.  
  23.  
  24. print(new_text)
Add Comment
Please, Sign In to add comment