Oct-01-2020, 05:07 PM
I would be really surprised if isalpha doesn't work. You can test easily enough using the examples in metulburr's post.
You should be trying to debug this problem yourself. The first thing I would have done was start with a much shorter and more interesting story, at least from a programming point of view.
After doing that research I might consider posting a question on the forum. My research would probably solve the problem and I wouldn't have to wait for an answer. If I still had questions I would ask a better question and be in a better position to understand the answer.
You should be trying to debug this problem yourself. The first thing I would have done was start with a much shorter and more interesting story, at least from a programming point of view.
story = 'aA 12 !@#$%^&*()+=-~' for letter in story: if letter.isalpha(): print(letter, letter.)If this didn't give me the expected results I would test if isalpha worked as expected.
story = 'aA 12 !@#$%^&*()+=-~' for letter in story: print(letter, 'isalpha =', letter.isalpha())Depending on the results I would check the documentation to determine if I was doing the loop right or using isalpha() correctly.
After doing that research I might consider posting a question on the forum. My research would probably solve the problem and I wouldn't have to wait for an answer. If I still had questions I would ask a better question and be in a better position to understand the answer.