jackfrued / jackfrued/Python-100-Days
day 9中的奥特曼小怪兽哪部分中,用了属性限制,但是为什么可以直接用了?
Open
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 187k
- Forks
- 55.8k
- PR merge metrics
- No merged PRs in 30d
Description
里面奥特曼部分有self._mp = mp,但是为什么可以直接用,不是限制了吗,day8里不是有反例的吗?
另外形参有other, def attack(self,other):
other.hp -= randint(15,25)
那other是奥特曼时,里面是_hp呀,为什么可以呢?
有点晕
不明白限制到底是什么程度,希望作者可以解答一下,万分感谢!!!
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
Read the Day 8 and Day 9 lesson material referenced in the question, then trace the attribute access in the shown self._mp = mp and attack(self, other) examples. Done means clarifying the intended attribute-access behavior and the _hp/hp distinction in the relevant lesson documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100