fizzbuzz-kata 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ """FizzBuzz kata package."""
2
+
3
+ from .core import fizzbuzz
4
+
5
+ __all__ = ["fizzbuzz"]
6
+
7
+ __version__ = "0.1.0"
fizzbuzz_kata/core.py ADDED
@@ -0,0 +1,20 @@
1
+ def fizzbuzz(n: int) -> str:
2
+ """Return the FizzBuzz representation of the integer n.
3
+
4
+ Contract:
5
+ - if n is a multiple of 3 AND 5: "FizzBuzz"
6
+ - if n is a multiple of 3 only: "Fizz"
7
+ - if n is a multiple of 5 only: "Buzz"
8
+ - otherwise: str(n)
9
+
10
+ Raises ValueError if n is not a strictly positive integer.
11
+ """
12
+ if not isinstance(n, int) or n <= 0:
13
+ raise ValueError("fizzbuzz expects a strictly positive integer")
14
+
15
+ result = ""
16
+ if n % 3 == 0:
17
+ result += "Fizz"
18
+ if n % 5 == 0:
19
+ result += "Buzz"
20
+ return result or str(n)
@@ -0,0 +1,7 @@
1
+ Metadata-Version: 2.5
2
+ Name: fizzbuzz-kata
3
+ Version: 0.1.0
4
+ Summary: A TDD kata: FizzBuzz, from notebook exploration to a tested, published package
5
+ Author-email: Your Name <you@example.com>
6
+ License: MIT
7
+ Requires-Python: >=3.11
@@ -0,0 +1,5 @@
1
+ fizzbuzz_kata/__init__.py,sha256=SWo96xUO-8jMWQhEHpEYOQSgYSnWSKvL_ump4jnLYjI,103
2
+ fizzbuzz_kata/core.py,sha256=7BsWLxmXBDfJ9tFWz2s7C62zOP_oUXNwp71VynEV2Pw,580
3
+ fizzbuzz_kata-0.1.0.dist-info/METADATA,sha256=iybtEKRJA9Ya_J66axeYDdHT8XY_QHmv5sdwGMbOJK4,224
4
+ fizzbuzz_kata-0.1.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
5
+ fizzbuzz_kata-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.4
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any