Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to define a success criterion function that returns True if the agent's score is above 80.
Agentic AI
def success_criterion(score): return score [1] 80
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' will mark low scores as success.
Using '==' is too strict and only accepts exactly 80.
✗ Incorrect
The success criterion checks if the score is greater than 80, so the correct operator is '>'.
2fill in blank
mediumComplete the code to define a function that returns True if the agent's task completion time is less than the allowed time.
Agentic AI
def success_criterion(completion_time, allowed_time): return completion_time [1] allowed_time
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>' would mean finishing after the allowed time is success.
Using '==' is too strict and only accepts exact matches.
✗ Incorrect
The agent succeeds if it finishes before the allowed time, so completion_time must be less than allowed_time.
3fill in blank
hardFix the error in the success check that should return True if the agent's accuracy is at least 90%.
Agentic AI
def success_criterion(accuracy): return accuracy [1] 0.9
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' or '<=' would mark low accuracy as success.
Using '==' only accepts exactly 0.9 accuracy.
✗ Incorrect
The success criterion requires accuracy to be at least 90%, so '>=' is the correct operator.
4fill in blank
hardFill both blanks to create a success criterion that returns True if the agent's reward is greater than 50 and the error is less than 0.1.
Agentic AI
def success_criterion(reward, error): return reward [1] 50 and error [2] 0.1
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>=' or '<=' changes the strictness of the condition.
Mixing up the operators reverses the logic.
✗ Incorrect
The agent succeeds if reward is greater than 50 and error is less than 0.1, so the operators are '>' and '<'.
5fill in blank
hardFill all three blanks to define a success criterion that returns True if the agent's score is at least 75, time is less than 120, and errors are at most 5.
Agentic AI
def success_criterion(score, time, errors): return score [1] 75 and time [2] 120 and errors [3] 5
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>' instead of '>=' excludes exact 75 score.
Using '>' or '>=' for time or errors reverses the logic.
✗ Incorrect
The agent succeeds if score >= 75, time < 120, and errors <= 5, so the operators are '>=', '<', and '<=' respectively.