File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 1- def integer_to_roman (n : int ) -> str :
1+ def integer_to_roman (number : int ) -> str :
22 """
33 Convert an integer to a Roman numeral.
44
@@ -18,7 +18,7 @@ def integer_to_roman(n: int) -> str:
1818 ...
1919 ValueError: number must be between 1 and 3999
2020 """
21- if not (1 <= n <= 3999 ):
21+ if not (1 <= number <= 3999 ):
2222 raise ValueError ("number must be between 1 and 3999" )
2323
2424 symbols = [
@@ -39,14 +39,13 @@ def integer_to_roman(n: int) -> str:
3939
4040 result = []
4141 for value , numeral in symbols :
42- while n >= value :
42+ while number >= value :
4343 result .append (numeral )
44- n -= value
44+ number -= value
4545
4646 return "" .join (result )
4747
4848
4949if __name__ == "__main__" :
5050 import doctest
5151 doctest .testmod ()
52-
You can’t perform that action at this time.
0 commit comments