Software Development with Claude Code
Dani Zysman
AI Curriculum Manager @ DataCamp

$ curl -fsSL https://claude.ai/install.sh | bash
For more info visit: https://code.claude.com/docs/en/overview
$ cd /path/to/your/project
$ claude
Useful commands:
/clear to clear conversation history/exit or Ctrl + C to exit the session/help shows available commandsdef process_data(records, threshold=0.5):
result = []
for r in records:
if r.get('value') and r['value'] > threshold:
x = r['value'] * 1.1 if r.get('premium') else r['value']
result.append({'id': r['id'], 'adjusted': x, 'flag': x > 1})
return sorted(result, key=lambda d: d['adjusted'], reverse=True)[:10]
> What does process_data() do?
process_data(): Filter, Adjust & Rank
Filter: Keep records where value > threshold (default: 0.5)
Adjust: Apply 10% boost if premium=True
Transform: Output id, adjusted value, and flag (if adjusted > 1)
Sort: Return top 10 by adjusted descending
> Add a docstring to process_data()
"""Filter records above threshold, apply 10% premium uplift, and return
the top 10 by adjusted value."""
def add_item(item, item_list=[]):
item_list.append(item)
return item_list
Can you spot the issue?
> Find the bug in add_item() and fix it
Bug found and fixed: The issue was a mutable default argument.
Using item_list=[] means all calls to add_item() without providing a
list argument would share the same default list object,
causing items to accumulate across calls.
def add_item(item, item_list=None):
if item_list is None:
item_list = []
item_list.append(item)
return item_list
| Issue | Solution |
|---|---|
| "Context window exceeded" | Use /clear to reset |
| Rate limits | Wait and retry |
| Poor results | Keep prompts focused on one task |

Software Development with Claude Code