CommencerCommencer gratuitement

Analytical problem solving with Claude

After your successful promo, website traffic jumped 40 %, yet paid subscriptions crawled up only 5 %. Activate Claude’s extended thinking to unpack this mismatch: the detailed analysis will guide SkyTrack’s next growth sprint.

The anthropic library and client are preloaded.

Cet exercice fait partie du cours

Introduction to Claude Models

Afficher le cours

Instructions

  • Create an analytical thinking prompt.
  • Use the thinking parameter in your API call to turn on extended thinking.
  • Set a high max_tokens, such as 1400, to give Claude enough room for reasoning and the answer.
  • Print the analysis results.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Create an analytical thinking prompt
analysis_prompt = """
Analyze this business scenario and walk me through your reasoning:
Our website traffic increased 40% but sales only grew 5%.
___
Provide multiple possible explanations and rank them by likelihood.
"""

# Request detailed analytical thinking
response = client.messages.create(model="claude-3-7-sonnet-latest", thinking=____, max_tokens=____, messages=[{"role": "user", "content": analysis_prompt}])
# Print the analysis results
print("Analysis results:")
print(response.content[0].thinking)
Modifier et exécuter le code