1. Learn
  2. /
  3. Courses
  4. /
  5. Intermediate Object-Oriented Programming in Python

Connected

Exercise

Type hinting with custom classes

In this exercise, you'll use built-in type keywords, the typing library, and your own custom class to practice type hinting. List has been imported from the typing library. Time to get started!

Instructions 1/3

undefined XP
    1
    2
    3
  • Create an Agent class that takes the parameters codename (a string), and missions (an integer); add type hints to both the constructor definition, and the method itself.