Introduction
When a problem happens, it can be tricky to fix it if you only treat the surface symptoms. Root cause analysis helps find the real reason behind a problem so you can solve it properly and prevent it from happening again.
Imagine your car won't start. Instead of just pushing it to get it moving, you check the battery, fuel, and engine to find why it won't start. Fixing the real issue, like a dead battery, stops the problem from happening again.
┌─────────────────────┐
│ Problem Occurs │
└─────────┬───────────┘
│
▼
┌─────────────────────┐
│ Identify the Problem │
└─────────┬───────────┘
│
▼
┌─────────────────────┐
│ Gather Data │
└─────────┬───────────┘
│
▼
┌─────────────────────┐
│ Analyze Causes │
└─────────┬───────────┘
│
▼
┌─────────────────────┐
│Find Root Cause │
└─────────┬───────────┘
│
▼
┌─────────────────────┐
│ Implement Solution │
└─────────────────────┘def five_whys(problem): causes = [] current_cause = problem for i in range(5): cause = input(f"Why {current_cause}? ") causes.append(cause) current_cause = cause return causes print("Start Root Cause Analysis using 5 Whys") problem = input("Describe the problem: ") root_causes = five_whys(problem) print("Root cause analysis steps:") for i, cause in enumerate(root_causes, 1): print(f"Why {i}: {cause}")