Skip to content

JingSyue/filter_list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Filter List Project

Overview

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.

Features

  • 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.

Usage

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)

Requirements

  • Python 3.6 or higher
  • pytest (for running tests)

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.

Contributing

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.

License

Distributed under the MIT License. See LICENSE for more information.

About

Coding Challenge of Sailing Downstream task

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages