diff --git a/refactoring.html b/refactoring.html index ba6fe2d..c8e521f 100755 --- a/refactoring.html +++ b/refactoring.html @@ -74,10 +74,10 @@ FAILED (failures=1)
def from_roman(s):
'''convert Roman numeral to integer'''
- if not s: ①
+ if not s: ①
raise InvalidRomanNumeralError, 'Input can not be blank'
if not re.search(romanNumeralPattern, s):
- raise InvalidRomanNumeralError, 'Invalid Roman numeral: {0}'.format(s)
+ raise InvalidRomanNumeralError, 'Invalid Roman numeral: {}'.format(s) ②
result = 0
index = 0
@@ -88,6 +88,7 @@ FAILED (failures=1)
return result
raise statement.
+{0} to refer to the first parameter to the format() method, you can simply use {} and Python will fill in the proper positional index for you. This works for any number of arguments; the first {} is {0}, the second {} is {1}, and so forth.