September 2023
Intermediate to advanced
344 pages
8h 50m
English
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))Read now
Unlock full access