ÎncepețiÎncepe gratuit

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.

Acest exercițiu face parte din cursul

Software Development with Claude Code

Vezi cursul

Instrucțiuni pentru exercițiu

  • Start Claude Code with claude.
  • Ask Claude to explain the calculate_album_stats() function in analytics.py.
  • When done exploring, type /exit to exit Claude Code.

Exercițiu interactiv practic

Transformă teoria în practică cu unul dintre exercițiile noastre interactive

Începe exercițiul