Question: Need help defining a class that returns only odd or even numbers Problem/Solution Requirements: Test Code: Thank you very much! Solution Specifications Your solution to

Need help defining a class that returns only odd or even numbers

Problem/Solution Requirements:

Need help defining a class that returns only odd or even numbers

Test Code:

Problem/Solution Requirements: Test Code: Thank you very much! Solution Specifications Your solution

Thank you very much!

Solution Specifications Your solution to this problem must meet the following criteria. 1. You must define a class NumberList in the file number_list.py with one attribute for the list of integers. 2. Create two instance methods in NumberList: - get_even returns a list of only the even numbers - get_odd returns a list of only the odd numbers import number_list test_list = [1,2,3,4,5,6,7,8] my_list = number_list.NumberList(test_list) print(my_list.get_even()) print(my_list.get_odd())

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!