A port of the infamous left-pad npm package
Project description
leftpad
Left pad a string in Python.
Done to try out creating a pip package and uploading it to the Python Package Index (PyPI).
Install
pip install leftpad
Usage
from leftpad import left_pad
left_pad("foo", 5)
// => " foo"
left_pad("foobar", 6)
// => "foobar"
left_pad(1, 2, '0')
// => "01"
left_pad(17, 5, 0)
// => "00017"
Testing
Run python -m doctest leftpad.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
leftpad-0.1.0.tar.gz
(1.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file leftpad-0.1.0.tar.gz.
File metadata
- Download URL: leftpad-0.1.0.tar.gz
- Upload date:
- Size: 1.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab25717213266f4232aed9fa0baa0fba440e85093c6f269e26eaf1a4d893b4ca
|
|
| MD5 |
9997d53d72ada069ecf05e8e17ef4c40
|
|
| BLAKE2b-256 |
5b98caac888665c5391ca649baaf8694e64b508a99cd72ec5c1bd2e35fd45dc1
|
File details
Details for the file leftpad-0.1.0-py3-none-any.whl.
File metadata
- Download URL: leftpad-0.1.0-py3-none-any.whl
- Upload date:
- Size: 1.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4b9bf80d42425273c2494144b77d6275be7a1e74a782c8ac47659f11c5b0dbf
|
|
| MD5 |
5ba9683eeff4be6b05a05f346bc3b09c
|
|
| BLAKE2b-256 |
8ef517fcd6883f0c6687cf765a1d30542f18a63bd1052cfc67ed45833a7fca06
|