Overview
This is a simple Python package for calculating the Fibonacci sequence. This package is created for testing purposes and uploading to PyPI.
Installation
You can install this package using pip:
pip install fibonacci_package
Example
Once installed, you can use the package in your Python scripts. Here are two different ways to calculate the Fibonacci sequence:
Recursive Algorithm
from fibonacci_package.fibonacci import calculate_fibonacci
# Get the number of terms from the user
n = int(input("Enter the number of terms you want in the Fibonacci sequence: "))
# Calculate the Fibonacci sequence
result = calculate_fibonacci(n)
# Print the result
print(f"The first {n} terms of the Fibonacci sequence are: {result}")
Memoizing the Recursive Algorithm
from fibonacci_package.fibonacci import fibonacci_with_memoization
n = int(input("Enter the number of terms you want in the Fibonacci sequence: "))
fibonacci_sequence = [fibonacci_with_memoization(i) for i in range(n)]
print(f"The first {n} terms of the Fibonacci sequence (memoized) are: {fibonacci_sequence}")
Output for two cases
python your_script.py
Enter the number of terms you want in the Fibonacci sequence: 10
The first 10 terms of the Fibonacci sequence are: [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
Metadata
Release files for fibonacci-package 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fibonacci_package-0.3.1.tar.gz | 1.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fibonacci_package-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 4.3 kB
Release files / fibonacci_package-0.3.1.tar.gz
| Download URL | fibonacci_package-0.3.1.tar.gz |
|---|---|
| Size | 1.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e1d0c0904dd2d94b5e49b7a97496722791b3beb221e6e94a9e9dbc64477156e8
|
|
BLAKE2b-256 checksum How to use checksums |
5c531ac45bfd7e1ff67a6dcde4f737bd8129113238b8cecb1b8b4e6795799e5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.13
|
Release files / fibonacci_package-0.3.1-py3-none-any.whl
| Download URL | fibonacci_package-0.3.1-py3-none-any.whl |
|---|---|
| Size | 2.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
98ce12fcb6e260d7eba00529fb3ec462e7963031941c217266afdcb2c641f165
|
|
BLAKE2b-256 checksum How to use checksums |
f00c9107dcdf34cc7e97304700b0419d7c6975f020a3e70d6e1b99f9f20cb3ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.13
|