← Quiz: First API Call: all 10 questions
Quiz: First API Call · Question 8 of 10
Why should you check block.type before reading text from response.content?
Why should you check block.type before reading text from response.content?
- A.Content is a list of blocks, and some blocks (such as tool calls) are not text
- B.The text is always in the last block
- C.block.type tells you the price
- D.Python requires it for every list
Answer & explanation
Correct answer: Content is a list of blocks, and some blocks (such as tool calls) are not text
Later lessons add tool_use blocks to the same list.
Can you get the rest right without peeking?
Take the timed Quiz: First API Call quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →