Generates Fibonacci series with an end number OR a length argument.
Project description
Fibonacci Series
Fibonacci Series is a list of numbers in which one number on the series is the sum of the previous two numbers.
def fibonacci(end=None, start=0, inclusive=True, length=None):
...
Installation and usage
pip install py-fibonacci
from fibonacci import fibonacci
e.g. fibonacci(39) -> returns a list, you may assign it to a variable or print it.
This python package of fibonacci series, provides two use cases:
- With an 'end' number argument:: so it is possible to list the fibonacci series up to that number and start (default: 0) number argument is optional. An optional boolean inclusive (default: True) argument makes the end number inclusive or exclusive.
examples:
fibonacci(39)
-> only end number is given. there are several fibonacci numbers upto 39 starting at 0.
fibonacci(39, 3)
-> end and start numbers are given. there are several fibonacci numbers upto 39 starting at 3.
fibonacci(39, 3, False)
-> end, start numbers and inclusive=False are given. there are several fibonacci numbers upto 39 (exclusive) starting at 3.
- With a 'length' number argument:: so it is possible to set the length of the series and start (default: 0) number argument is optional.
examples:
fibonacci(length=20)
-> only length of the series is given. there are 20 fibonacci numbers starting at 0.
fibonacci(start=5, length=20)
-> start number and length of the series is given. there are 20 fibonacci numbers starting at 5.
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
py-fibonacci-0.5.2.tar.gz
(2.3 kB
view details)
Built Distribution
File details
Details for the file py-fibonacci-0.5.2.tar.gz
.
File metadata
- Download URL: py-fibonacci-0.5.2.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
faba28da27092bc3e83c78fd73f0b0c5e3c548b9d7690b6194774441e03b84e7
|
|
MD5 |
4c1441461a47ae73094b651ada73ccf5
|
|
BLAKE2b-256 |
fc259ff754a72c15154120d739d6231bb7c6c53b4b2b77a0eb391cb5abee0597
|
File details
Details for the file py_fibonacci-0.5.2-py3-none-any.whl
.
File metadata
- Download URL: py_fibonacci-0.5.2-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
a31b97379f444384f2349e34a8cfd350d3219e45ac794cb0f9541db4e5476250
|
|
MD5 |
345387a07cba7766a69eb7e6d7c7e62c
|
|
BLAKE2b-256 |
1093b01c135d8aef1ed67cad94c08081385295c00a74d8243fcbcd5b8efe138f
|