Magic numbers make code unreadable. What does 86400000 mean? What about 0.2?
# dirty
def solve(price_in_cents, age_in_ms):
discounted = price_in_cents * (1 - 0.2)
age_in_days = age_in_ms // 86400000
return {'discounted': round(discounted), 'age_in_days': age_in_days}Refactor by introducing named constants so the intent is self-documenting.
The output must remain identical.
Sample tests