Skip to main content

Counts until condition. Infinite counting is also supported.

Project description

Overview

Counts until condition. Infinite counting is also supported.

Installation

To install upcounting, you can use pip. Open your terminal and run:

pip install upcounting

Implementation

def count_up(start=0, stop=None, step=1):
    ans = start
    while True:
        if stop is None:
            pass
        elif callable(stop):
            if stop(ans):
                break
        else:
            if ans >= stop:
                break
        yield ans
        ans += step

License

This project is licensed under the MIT License.

Credits

Thank you for using upcounting!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

upcounting-1.0.2.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

upcounting-1.0.2-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file upcounting-1.0.2.tar.gz.

File metadata

  • Download URL: upcounting-1.0.2.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for upcounting-1.0.2.tar.gz
Algorithm Hash digest
SHA256 c4909355c76192b3a021630b422318e04223feebf04b816fe33df75091193fe2
MD5 fb198e6e10d91ca18af8a37a8e97f675
BLAKE2b-256 ac8f35ae1967408deb6082f0c0cb74aa90545b39f58223bb34c83a64bc0c504e

See more details on using hashes here.

File details

Details for the file upcounting-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: upcounting-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for upcounting-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ddb06101c98b659521115eed8b61bf86765cc2790d0ecad914069d78faca3afd
MD5 0cf3085cb3b9fa0ad19029be62c47bb2
BLAKE2b-256 e212b930a1d6fcfaa840b6897e294f4a133df9f3aa8903a91f6e83541bdebac1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page