Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. mess = open('c://riddles//mess.txt')
  2. tidy_string = ""
  3.  
  4. def cleanline(line):
  5.     cleaned = ""
  6.     for char in line:
  7.         if (ord('a') <= ord(char) <= ord('z')):
  8.             cleaned += char
  9.     return cleaned
  10.  
  11. for line in mess:
  12.             tidy_string += cleanline(line)
  13.  
  14.            
  15. print tidy_string
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement