Python
Python copied to clipboard
unit tests under bit_manipulation
Summary
This PR adds a new function scale_list under the bit_manipulation/ folder.
What It Does
- The
scale_listfunction takes a list of numbers and a scaling factor, and returns a new list with each element multiplied by the factor. - Includes a unit test file
test_scale_list.pyto verify correctness.
Why It's Useful
This provides a simple mathematical utility for scaling lists — useful in data preprocessing and basic arithmetic operations.
Notes
- All code follows PEP8 style.
- All tests pass using
unittest.
Folder: bit_manipulation/
-
scale_list.py -
test_scale_list.py