Python Course Design Note 20 of 52

Namespaces

Chapter12

Task Name - Namespaces

Task Overview

  1. Understand the concept of namespaces
  2. Understand the concept of bound methods
  3. 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

  1. What is the purpose of the initializer function, and what are its characteristics?
  2. What is a bound method, and what are its characteristics?
  3. What is the attribute lookup order for objects and classes?
  4. What is a class, and what is an object? (review)
  5. 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