Bird
0
0

Which of the following is the correct way to write a condition that asks for human approval if the AI confidence is below 0.7?

easy📝 Syntax Q12 of 15
Agentic AI - Agent Safety and Guardrails
Which of the following is the correct way to write a condition that asks for human approval if the AI confidence is below 0.7?
A<code>if confidence != 0.7: request_approval()</code>
B<code>if confidence < 0.7: request_approval()</code>
C<code>if confidence == 0.7: request_approval()</code>
D<code>if confidence > 0.7: request_approval()</code>
Step-by-Step Solution
Solution:
  1. Step 1: Understand the condition logic

    We want to request human approval when confidence is less than 0.7, so the condition should check for values below 0.7.
  2. Step 2: Match the correct syntax

    The correct syntax is if confidence < 0.7: followed by the approval request function.
  3. Final Answer:

    if confidence < 0.7: request_approval() -> Option B
  4. Quick Check:

    Less than 0.7 triggers approval [OK]
Quick Trick: Use < for 'below' conditions in code [OK]
Common Mistakes:
  • Using > instead of <
  • Checking equality instead of less than
  • Using != which triggers on all but 0.7

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Agentic AI Quizzes