Skip to content

Commit 2413468

Browse files
authored
Apply suggestions from code review
1 parent f71b575 commit 2413468

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

maths/numerical_analysis/proper_fractions.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import doctest
21
from math import gcd
32

43

54
def proper_fractions(denominator: int) -> list[str]:
65
"""
76
this algorithm returns a list of proper fractions, in the
87
range between 0 and 1, which can be formed with the given denominator
9-
proper fractions: https://en.wikipedia.org/wiki/Fraction#:~:text=Proper%20and%20improper,and%203/3.
8+
https://en.wikipedia.org/wiki/Fraction#Proper_and_improper_fractions
109
1110
>>> proper_fractions(10)
1211
['1/10', '3/10', '7/10', '9/10']
@@ -25,7 +24,7 @@ def proper_fractions(denominator: int) -> list[str]:
2524
if denominator < 0:
2625
raise ValueError("The Denominator Cannot be less than 0")
2726
elif isinstance(denominator, float):
28-
raise ValueError("The Denominator has to be an integer")
27+
raise ValueError("The Denominator must be an integer")
2928
return [
3029
f"{numerator}/{denominator}"
3130
for numerator in range(1, denominator)

0 commit comments

Comments
 (0)