Exercise 3 solution (Python) def to_min(t): h, m = t.split(":") return int(h) * 60 + int(m) def decide(now, turn_back, visibility, min_vis, group_ok): reasons = [] if to_min(now) >= to_min(turn_back): reasons.append("past turn-back time") if visibility < min_vis: reasons.append("visibility below minimum") if not group_ok: reasons.append("a member is struggling") if reasons: return "TURN BACK: " + ", ".join(reasons) return "Continue" print(decide("12:50", "13:20", 60, 30, True)) print(decide("13:25", "13:20", 60, 30, True)) print(decide("12:50", "13:20", 20, 30, False)) Output: Continue TURN BACK: past turn-back time TURN BACK: visibility below minimum, a member is struggling Each condition is checked separately and any one of them is enough. The function returns every reason, not just the first, because the real value of the rule is that the decision is made by criteria set in advance, not argued out on the hill when everyone is tired and wants to reach the top.