Python Course Design Note 20 of 52
Namespaces
Chapter12
Task Name - Namespaces
Task Overview
- Understand the concept of namespaces
- Understand the concept of bound methods
- Understand that everything in Python is an object
Community Topic
How should we understand that everything in Python is an object?
Details
Examples of typical object operations; using an object’s methods is extremely important
Check-in Requirements
- What is the purpose of the initializer function, and what are its characteristics?
- What is a bound method, and what are its characteristics?
- What is the attribute lookup order for objects and classes?
- What is a class, and what is an object? (review)
- Program design:
Simple Honor of Kings
1. Design a hero class for Honor of Kings; each hero object can use skills on other hero objects
2. A hero has the following attributes: hero name, level, HP, and three damage attributes Q_hurt, W_hurt, E_hurt, indicating the damage of each skill
3. It has the following skills: Q, W and E each take an enemy hero as an argument; when the enemy's HP is less than or equal to 0, print that the character has died