mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-23 09:38:27 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
07721a89e2
commit
668b78a6d4
|
@ -24,7 +24,7 @@ def roman_to_int(roman):
|
||||||
vals = {roman: arabic for arabic, roman in ROMAN}
|
vals = {roman: arabic for arabic, roman in ROMAN}
|
||||||
i, total = 0, 0
|
i, total = 0, 0
|
||||||
while i < len(roman):
|
while i < len(roman):
|
||||||
if i + 1 < len(roman) and roman[i + 1] == "_":
|
if i + 1 < len(roman) and roman[i + 1] == "_":
|
||||||
total += vals[roman[i] + "_"]
|
total += vals[roman[i] + "_"]
|
||||||
i += 2
|
i += 2
|
||||||
else:
|
else:
|
||||||
|
@ -52,7 +52,7 @@ def int_to_roman(number):
|
||||||
if number == 0:
|
if number == 0:
|
||||||
break
|
break
|
||||||
return "".join(result)
|
return "".join(result)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import doctest
|
import doctest
|
||||||
doctest.testmod()
|
doctest.testmod()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user