Claude Code로 배우는 Software Development
Dani Zysman
AI Curriculum Manager @ DataCamp

$ curl -fsSL https://claude.ai/install.sh | bash
자세한 내용은 다음을 참고하세요: https://code.claude.com/docs/en/overview
$ cd /path/to/your/project
$ claude
유용한 명령어:
/clear: 대화 기록 지우기/exit 또는 Ctrl + C: 세션 종료/help: 사용 가능한 명령어 표시def 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
문제를 찾을 수 있나요?
> 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
| 문제 | 해결 방법 |
|---|---|
| "Context window exceeded" | /clear로 초기화 |
| 속도 제한 | 잠시 후 다시 시도 |
| 결과가 부정확함 | 한 가지 작업에 집중한 프롬프트 작성 |

Claude Code로 배우는 Software Development