Getting Started with Claude Code
You're a developer who just joined a new team working on a music analytics platform. Your colleague mentioned that Claude Code can help you understand unfamiliar codebases quickly.
Your project directory contains analytics.py with this function:
def calculate_album_stats(albums, min_tracks=5, multiplier=1.2):
"""Process album data and return statistics for qualifying albums."""
output = []
for album in albums:
track_count = album.get('track_count', 0)
if track_count > min_tracks:
adjusted_popularity = album.get('popularity', 0) * multiplier
tier = 'platinum' if adjusted_popularity > 80 else 'gold'
output.append({
'album_id': album['album_id'],
'title': album['title'],
'original_popularity': album.get('popularity', 0),
'adjusted_popularity': adjusted_popularity,
'tier': tier
})
return sorted(output, key=lambda x: x['adjusted_popularity'], reverse=True)[:5]
Note: For instructions on how to set Claude Code up on your own machine, check the setup guide.
Bài tập này là một phần của khóa học
Software Development with Claude Code
Hướng dẫn bài tập
- Start Claude Code with
claude. - Ask Claude to explain the
calculate_album_stats()function inanalytics.py. - When done exploring, type
/exitto exit Claude Code.
Bài tập tương tác thực hành
Biến lý thuyết thành hành động với một trong các bài tập tương tác của chúng tôi
Bắt đầu bài tập