Bird
Raised Fist0
Agentic AIml~10 mins

Error rate and failure analysis in Agentic AI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to calculate the error rate given the number of errors and total samples.

Agentic AI
error_rate = errors / [1]
Drag options to blanks, or click blank then click option'
Atotal_samples
Bcorrect_predictions
Cerrors
Dpredictions
Attempts:
3 left
💡 Hint
Common Mistakes
Dividing errors by errors instead of total samples
Using correct predictions as denominator
2fill in blank
medium

Complete the code to compute the failure rate as a percentage.

Agentic AI
failure_rate = (failures / total_tests) * [1]
Drag options to blanks, or click blank then click option'
A10
B0.01
C100
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Multiplying by 0.01 instead of 100
Forgetting to multiply at all
3fill in blank
hard

Fix the error in the code to calculate the failure count from error rate and total attempts.

Agentic AI
failure_count = [1] * total_attempts
Drag options to blanks, or click blank then click option'
Asuccess_rate
Berror_rate
Ctotal_attempts
Dfailure_rate
Attempts:
3 left
💡 Hint
Common Mistakes
Using total_attempts instead of error_rate
Using success_rate which is the opposite
4fill in blank
hard

Fill both blanks to create a dictionary that maps test names to their failure counts only if failures are greater than zero.

Agentic AI
failure_dict = {test: [1] for test, failures in test_results.items() if failures [2] 0}
Drag options to blanks, or click blank then click option'
Afailures
B>
C==
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using equality instead of greater than
Using test name instead of failure count as value
5fill in blank
hard

Fill all three blanks to create a dictionary of failure rates for tests with failures above threshold.

Agentic AI
failure_rates = {test: failures / [1] for test, failures in test_results.items() if failures [2] threshold and failures [3] 0}
Drag options to blanks, or click blank then click option'
Atotal_tests
B>
C!=
Dtotal_attempts
Attempts:
3 left
💡 Hint
Common Mistakes
Using total_tests instead of total_attempts
Using equality instead of inequality in conditions