MulaiMulai sekarang secara gratis

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.

Latihan ini adalah bagian dari kursus

Software Development with Claude Code

Lihat Kursus

Petunjuk latihan

  • 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.

Latihan interaktif praktis

Ubah teori menjadi tindakan dengan salah satu latihan interaktif kami.

Mulai berolahraga