#!/usr/bin/env python3
+"""A class to represent a rate of change."""
+
from typing import Optional
class Rate(object):
+ """A class to represent a rate of change."""
+
def __init__(
self,
multiplier: Optional[float] = None,
self.multiplier = 1.0 + percent_change / 100
count += 1
if count != 1:
- raise Exception(
- 'Exactly one of percentage, percent_change or multiplier is required.'
- )
+ raise Exception('Exactly one of percentage, percent_change or multiplier is required.')
def apply_to(self, other):
return self.__mul__(other)