Day05 查找find函数用法相关资料的时候,对示例里的运行结果不理解
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- python
- Domain
- documentation
Research direction
No file or test is named in the issue. Start by checking Python's str.find return values and how integers are evaluated in an if condition; done means explaining why the two examples print different results, preferably with a corrected condition or clearer example.
Written by the indexing model from the issue text.
Description
如图看到了如下两段代码:
第一段:
str = "01213456"
if str.find("23"):
print ("YES!")
else:
print ("NO!")
第二段:
str = "01213456"
if str.find("01"):
print("YES!")
else:
print ("NO!")
两段运行的结果分别为1:YES! 2:NO!
不能理解为什么会出现这种不同。
- Dominant language
- Python
- Stars
- 151
- Forks
- 875
- PR merge metrics
- No merged PRs in 30d
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.
More from xiaolai/selfteaching-python-camp
-
这个自学群还有战友,一起学习么 Open
Difficulty 5/5 Over a week Newbie friendliness 5/100
xiaolai/selfteaching-python-camp#6223 · 1 comment ·
-
属性“program”不存在错误 Open
Difficulty 3/5 1-2 days Newbie friendliness 20/100
xiaolai/selfteaching-python-camp#6182 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 15/100
xiaolai/selfteaching-python-camp#6181 ·
-
day05 如何按照从大到小排序呢? Open
Difficulty 1/5 Under an hour Newbie friendliness 35/100
xiaolai/selfteaching-python-camp#6046 ·
-
停了6个月,又开始学习了。 Open
Difficulty 5/5 Over a week Newbie friendliness 5/100
xiaolai/selfteaching-python-camp#6032 ·
All issues in xiaolai/selfteaching-python-camp
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100