🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.Content is a list of blocks, and some blocks (such as tool calls) are not text
  2. B.The text is always in the last block
  3. C.block.type tells you the price
  4. 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 →