[Tutor] Punctuation

Diego Prestes lobow@brturbo.com
Mon Dec 2 08:01:01 2002


---1129270052.1038833871425.JavaMail.nobody.webmail1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

    Hello!
  
      Im trying to make a program that remove the punctuations of a txt file or string because I want to do a count of words later. But when a make my program it give Out of memory error. Someone know a better way to do this program?

Diego

from string import *
text = raw_input("Text :")
d1 = punctuation
d = split(join(d," "))
for x in range(len(d)):
    n = find(text,d[x])
    text = text[:n] + text[n+1:]
print text
---1129270052.1038833871425.JavaMail.nobody.webmail1--