Untitled
plain_text
3 days ago
567 B
4
Indexable
Never
import string def read(): f = open("gruffalo.txt", "r") word = "" while True: character = f.read(1) if not character: break if character in string.ascii_letters: word += character elif character in string.punctuation: if character == "'": word += character else: print(word) print(character) word = "" else: print(word) word = "" f.close read()