selfteaching / selfteaching/selfteaching-python-camp

Day06 int类型的count与len比较大小不成功,错误

Open
#3,091 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
151
Forks
875
PR merge metrics
No merged PRs in 30d

Description

def stats_text_en(text,count):
"""统计参数中每个英文单词出现的次数,最后返回一个按词频降序排列的数组"""
if isinstance(text,str):
string=text
text_1=re.sub(u'[\u4e00-\u9fa5,。??.!:,、“”]', " ",string)
seg_list = text_1.split()
x=int(count)
y=len(seg_list)
x <= y
tuple_0=tuple(seg_list)
return collections.Counter(tuple_0).most_common([100])
else:
print(f'输入的参数是{type(text)}类型,不是字符串类型。')
print(stats_text_en(text,5))
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the stats_text_en snippet included in the issue and inspect the count and len comparison. No source file or test is named, so locate the corresponding exercise before making changes. Done means the comparison behaves as intended for the provided call and the result is verified with a focused check.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.