Ormuco Code Challenge
This project has been created only for demonstration purpose.
The challenge
The goal of this question is to write a software library that accepts 2 version string as input and returns whether one is greater than, equal, or less than the other. As an example: “1.2” is greater than “1.1”. Please provide all test cases you could think of.
The Answer
source directory: ./compare_versions
- Run
pip3 install cf_compare_versions
usage:
from compare_versions.compare_versions import compare_versions
result = compare_versions('1.0.0.2.9', '1.0.0.3.4')
# It will return:
# A positive number: If the first version is greater than the second
# A negative number: If the first version is smaller than the second
# Zero: If the versions are equals
Metadata
Release files for cf-compare-versions 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cf_compare_versions-0.0.2.tar.gz | 1.7 kB | Without provenance | Details for cf_compare_versions-0.0.2.tar.gz |
Release files / cf_compare_versions-0.0.2.tar.gz
| Download URL | cf_compare_versions-0.0.2.tar.gz |
|---|---|
| Size | 1.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
947e363f0bc597cc62b0c82ebdf471cb6929a4b6e57529769279930fafd64885
|
|
BLAKE2b-256 checksum How to use checksums |
a28d0aea481f4e31bb94f84a2fcb757777f8657fe8a6d6b298307f241fb28608
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7
|
Security for cf-compare-versions 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.