A port of the infamous right-pad npm package
Project description
Rightpad
Right pad a string in Python.
Created to try out making a pip package and uploading it to the Python Package Index (PyPI).
Install
pip install rightpad
Usage
from rightpad import right_pad
right_pad("foo", 5)
// => "foo "
right_pad("foobar", 6)
// => "foobar"
right_pad(1, 2, '0')
// => "10"
right_pad(17, 5, 0)
// => "17000"
Testing
Run python -m doctest rightpad.py.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rightpad-0.1.0.tar.gz
(13.8 kB
view details)
File details
Details for the file rightpad-0.1.0.tar.gz.
File metadata
- Download URL: rightpad-0.1.0.tar.gz
- Upload date:
- Size: 13.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e64dc52201c68662afc8475f9ef5b7adcefa9b1ce7b9ef74cc7ae7db1b71f57c
|
|
| MD5 |
e2ee0df2cbdf84376ce00ffd5082c408
|
|
| BLAKE2b-256 |
0dc59e9eef2f204d246e95a8ace697f563e5e130300562a58b631ac6bd1e474c
|