Bird
0
0

Given the following code, what is the printed error rate?

medium📝 Predict Output Q13 of 15
Agentic AI - Agent Observability
Given the following code, what is the printed error rate?
total = 100
wrong = 7
error_rate = wrong / total
print(f"Error rate: {error_rate:.2f}")
AError rate: 7.00
BError rate: 0.07
CError rate: 0.70
DError rate: 0.007
Step-by-Step Solution
Solution:
  1. Step 1: Calculate error rate value

    error_rate = 7 / 100 = 0.07
  2. Step 2: Format output to 2 decimals

    Formatted as 0.07 in the print statement.
  3. Final Answer:

    Error rate: 0.07 -> Option B
  4. Quick Check:

    7 divided by 100 = 0.07 [OK]
Quick Trick: Divide wrong by total and format to two decimals [OK]
Common Mistakes:
  • Confusing 7% with 7.0
  • Multiplying instead of dividing
  • Misreading decimal places

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Agentic AI Quizzes