Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. s = 'abcdefghijklmnopqrstuvwxyz'
  2. s2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
  3. write = 'my_new.txt'
  4. files = "text.txt"
  5. my_files = open(files, mode='r', encoding='1251')
  6. my_files2 = open(write, mode='w', encoding='1251')
  7. for line in (my_files):
  8. my_files = line.split()
  9. for r in sorted(my_files):
  10. if r<s2 or r<s:
  11. print(r)
  12. my_files2.write(r+' ')
  13. my_files2.write('\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement