Question: Q1 Recursion and Exceptions 10 Points You've been hired to be a research assistant in Professor Oak's Pokemon lab. Your first assignment is to complete


Q1 Recursion and Exceptions 10 Points You've been hired to be a research assistant in Professor Oak's Pokemon lab. Your first assignment is to complete the functions _is_valid_num_pokemon() and recursive_count() You will only need to submit one file. class Trainer: MAX_POKEMON = 6 # The maximum number of Pokemon a Trainer can have is 6 def _init__(self, num_pokemon) : self.num_pokemon = self._is_valid_num_pokemon (num_pokemon) def _is_valid_num_pokemon(self, num_pokemon): This function will validate the num_pokemon parameter when we create a new trainer instance. If num_pokemon is too large it will return the class variable MAX_POKEMON try: assert num_pokemon
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
