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.
Este exercício faz parte do curso
Introduction to Claude Models
Instruções do exercício
- Create an analytical thinking prompt.
- Use the
thinkingparameter 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.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
# 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)