Here is the task:
Write a program that reads a file, breaks each line into words, strips whitespace and
punctuation from the words, and converts them to lowercase.
Hint: The string module provides a string named whitespace, which contains space, tab, newline,
etc., and punctuation which contains the punctuation characters.
Also, you might consider using the string methods strip, replace and translate
I tried everything but nothing works.
submitted by /u/tunnel26
[link] [comments]
r/learnpython Here is the task: Write a program that reads a file, breaks each line into words, strips whitespace and punctuation from the words, and converts them to lowercase. Hint: The string module provides a string named whitespace, which contains space, tab, newline, etc., and punctuation which contains the punctuation characters. Also, you might consider using the string methods strip, replace and translate I tried everything but nothing works. submitted by /u/tunnel26 [link] [comments]
Here is the task:
Write a program that reads a file, breaks each line into words, strips whitespace and
punctuation from the words, and converts them to lowercase.
Hint: The string module provides a string named whitespace, which contains space, tab, newline,
etc., and punctuation which contains the punctuation characters.
Also, you might consider using the string methods strip, replace and translate
I tried everything but nothing works.
submitted by /u/tunnel26
[link] [comments]