Prompts for effective debugging
You work at a banking company where you're building a pipeline that processes and stores user-submitted data. One preprocessing step converts strings to uppercase before saving them to a central database, but you've noticed a bug.
At this step, an input ['a', 'b', 'c'] should produce ['A', 'B', 'C'], but the current script returns ['C', 'C', 'C'] instead.
The process_data.py file, that the LLM can read and use, contains the faulty function:
def to_uppercase(strings):
  uppercased = [s.upper() for s in strings]
  return [uppercased[-1]] * len(strings)
Diese Übung ist Teil des Kurses
AI-Assisted Coding for Developers
Anleitung zur Übung
- Prompt the model to debug the function by including the **faulty code**, the **expected behavior**, and asking for clear **reasoning steps**.
Interaktive Übung
In dieser interaktiven Übung kannst du die Theorie in die Praxis umsetzen.
 Übung starten
Übung starten