We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e510a03 commit 96d953eCopy full SHA for 96d953e
1 file changed
conversions/roman_numerals.py
@@ -64,13 +64,11 @@ def int_to_roman(number: int) -> str:
64
TypeError: int_to_roman only accepts integers, got bool
65
"""
66
if not isinstance(number, int) or isinstance(number, bool):
67
- raise TypeError(
68
- f"int_to_roman only accepts integers, got {type(number).__name__}"
69
- )
+ msg = f"int_to_roman only accepts integers, got {type(number).__name__}"
+ raise TypeError(msg)
70
if not 1 <= number <= 3999:
71
- raise ValueError(
72
- f"int_to_roman only accepts integers in the range 1 to 3999, got {number}"
73
+ msg = f"int_to_roman only accepts integers in the range 1 to 3999, got {number}"
+ raise ValueError(msg)
74
result = []
75
for arabic, roman in ROMAN:
76
(factor, number) = divmod(number, arabic)
0 commit comments