Skip to main content
Home/Challenges/Coding/Find the Bug
AdvancedCoding~15 min

Find the Bug

Write a prompt that makes the AI identify ALL bugs in a given broken Python function — without fixing them first.

Skills Tested

Code debuggingStep separationEdge case identification

Challenge Prompt

This is the example prompt structure. Write your own variation below.

Analyse this Python function and list ALL bugs before fixing anything:
```python
def calculate_average(numbers):
    total = 0
    for i in range(len(numbers)):
        total += numbers[i]
    return total / len(numbers)
```
Step 1: List every bug or edge case failure (numbered). Step 2: For each bug, state what input would trigger it. Step 3: Write the corrected function. Do NOT fix anything in Step 1 or 2 — diagnose only.

Your Prompt

Write your own version. Every word matters — be specific.

🪙
Reward
+200 GeraCoins

Earn GeraCoins for completing this challenge. Redeem across all Gera products.

Hints (3)
  • 1Separating diagnosis from fix is the key technique — it prevents the AI from hiding bugs in the fix.
  • 2The function has at least 2 issues: ZeroDivisionError on empty list, no type checking.
  • 3"What input would trigger it" forces concrete test cases, not abstract descriptions.

Related Topics

debuggingPythoncode reviewedge casesstep-by-step analysis
Browse All Challenges