The filter_list
function is designed to process a list of integers, filtering out elements at positions that are multiples of 2 or 3. The function ensures the length of the input list is a multiple of 10, otherwise, it raises a ValueError
.
- Validates that the input list length is a multiple of 10.
- Filters out elements at positions that are multiples of 2 or 3.
- Raises a
ValueError
if the input list length condition is not met. - Includes robust testing with
pytest
to ensure functionality.
To use the filter_list
function, simply pass in a list of integers as an argument. Here's a quick example:
from filter_list import filter_list
try:
filtered_list = filter_list([1, 2, 3, ...]) # Replace with your list
print(filtered_list)
except ValueError as e:
print(e)
- Python 3.6 or higher
- pytest (for running tests)
To run tests for this function, execute the following command:
pytest test_filter_list.py
The tests will check for various scenarios including the validation of list length, the filtering functionality, and error handling.
Contributions to the filter_list
project are welcome! Please consider the following guidelines:
- Fork the repository and create a new branch for your feature.
- Write tests for new functionality.
- Ensure all tests pass before submitting a pull request.
Distributed under the MIT License. See LICENSE
for more information.