selfteaching / selfteaching/selfteaching-python-camp
Day6 怎样将文档中所有的特殊字符都去除呢?
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 151
- Forks
- 875
- PR merge metrics
- No merged PRs in 30d
Description
- text = input('请输入你要处理的文档:')
- def stats_text_en(text):
- text=text.replace('!',' ') #面对待处理的文档,没办法把可能出现的特殊字符都遍历一边然后替换,如果使用.isalpha()的话会把空格都删掉,该怎么办呢?
- text=text.lower()
- text=text.split()
- dict1={}
- for i in text:
- j=text.count(i)
- dict2={i:j}
- dict1.update(dict2)
- dict2=sorted(dict1.items(),key=lambda x:x[1],reverse=True)
- print(dict2)
- stats_text_en(text)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the stats_text_en entry point shown in the issue body and review how its input is split and counted. Confirm which special characters should be removed and how whitespace should be preserved, then verify that the resulting frequency output matches that behavior. No repository file or test is identified in the payload.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- content
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100