Sign In

scrambleeer

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scrambleeer

Shuffle a sequence of numbers, then swap the first and last values.

pipPyPI
Version
0.1.1
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created

scrambleeer

scrambleeer is a tiny Python package that shuffles a sequence of numbers and then swaps the first and last values. It returns a new list and does not modify the input sequence.

Installation

pip install scrambleeer

Usage

from scrambleeer import scrambleeer

numbers = [1, 2, 3, 4, 5]
scrambled = scrambleeer(numbers)

print(scrambled)
print(numbers)  # Still [1, 2, 3, 4, 5]

Empty and one-item sequences are supported:

scrambleeer([])       # []
scrambleeer([10])     # [10]

Development

Run the tests from the project root:

python -m unittest discover -s tests -v

Build the distributions:

python -m pip install --upgrade build twine
python -m build
python -m twine check dist/*

Publish to TestPyPI first:

python -m twine upload --repository testpypi dist/*

When the TestPyPI package works as expected, publish it to PyPI:

python -m twine upload dist/*

The name scrambleeer must be available on PyPI before it can be registered by the first upload. Update the version in pyproject.toml for every later release.

Keywords

shuffle

FAQs

Related posts