File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 35
35
36
36
37
37
def parse_roman_numerals (numerals : str ) -> int :
38
+ """
39
+ Converts a string of roman numerals to an integer.
40
+ e.g.
41
+ >>> parse_roman_numerals("LXXXIX")
42
+ 89
43
+ """
38
44
39
45
num = 0
40
46
@@ -53,6 +59,12 @@ def parse_roman_numerals(numerals: str) -> int:
53
59
54
60
55
61
def generate_roman_numerals (num : int ) -> str :
62
+ """
63
+ Generates a string of roman numerals for a given integer.
64
+ e.g.
65
+ >>> generate_roman_numerals(89)
66
+ 'LXXXIX'
67
+ """
56
68
57
69
numerals = ""
58
70
@@ -101,6 +113,13 @@ def generate_roman_numerals(num: int) -> str:
101
113
102
114
103
115
def solution () -> int :
116
+ """
117
+ Calculates and returns the answer to project euler problem 89.
118
+
119
+ Answer:
120
+ >>> solution()
121
+ 743
122
+ """
104
123
105
124
savings = 0
106
125
You can’t perform that action at this time.
0 commit comments