Assessments

Chapter 1 – Beyond Code Debugging

  1. Yes – here is an example that was provided in this chapter:
    def odd_counter(num_list: list):    """    :param num_list: list of integers to be checked for identifying odd numbers    :return: return an integer as the number of odd numbers in the input list    """    odd_count = 0    for num in num_list:        if (num % 2) == 0:            print("{} is even".format(num))        else:            print("{} is even".format(num))        odd_count += 1    return odd_countnum_list = [1, 2, 5, 8, 9]print(odd_counter(num_list))
  2. Here are their definitions:
    • AttributeError: This type of error is raised when an attribute is used for an object that it is not defined for. For example, isnull is not defined for ...

Get Debugging Machine Learning Models with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.