You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function prettify has a self-loop, but it doesn't account for a different character in the loop it just affects the first iteration.
This is the solution to the error.
def prettify(amount, separator=','): """Separate with predefined separator.""" orig = str(amount) new = re.sub("^(-?\d+)(\d{3})", "\g<1>{0}\g<2>".format(separator), str(amount)) if orig == new: return new else: return prettify(new, separator)
The text was updated successfully, but these errors were encountered:
The function prettify has a self-loop, but it doesn't account for a different character in the loop it just affects the first iteration.
This is the solution to the error.
def prettify(amount, separator=','): """Separate with predefined separator.""" orig = str(amount) new = re.sub("^(-?\d+)(\d{3})", "\g<1>{0}\g<2>".format(separator), str(amount)) if orig == new: return new else: return prettify(new, separator)
The text was updated successfully, but these errors were encountered: