Code Room
Code reviewMedium
Question
Review this Python pricing loop.
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.
Learn the concepts
class Cart: @property def tax_rate(self): # hits the rules engine; not cheap return load_tax_rules(self.region).effective_rate() def total(self): running = 0.0 for item in self.items: running += item.price * (1 + self.tax_rate) return runningRun or narrate your approach, then ask the coach.