Advertisement
niromru

Шпионы

Dec 18th, 2020
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. def povt(x):
  2.     s = []
  3.     for i in x:
  4.         ii = i.lower()
  5.         if ii in s:
  6.             return False
  7.         if ii not in s:
  8.             s.append(ii)
  9.     return True
  10.  
  11.  
  12. f1 = open('spies.txt', 'r')
  13. f2 = open('suspicions.txt', 'w')
  14. for i in f1:
  15.     for ii in i.split():
  16.         if povt(ii):
  17.             f2.write(ii + ' ')
  18.     f2.write('\n')
  19. f1.close()
  20. f2.close()
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement