Bird
0
0

Given this monitoring script snippet:

medium📝 Command Output Q4 of 15
Rest API - API Testing and Monitoring
Given this monitoring script snippet:
response_time = 3.5
if response_time > 2:
    alert = True
else:
    alert = False
print(alert)

What will be the output?
AFalse
BTrue
C3.5
DError
Step-by-Step Solution
Solution:
  1. Step 1: Evaluate the condition in the if statement

    response_time is 3.5, which is greater than 2, so condition is True.
  2. Step 2: Determine the value of alert and output

    Since condition is True, alert is set to True and printed.
  3. Final Answer:

    True -> Option B
  4. Quick Check:

    Condition true means alert True [OK]
Quick Trick: If response_time > 2, alert is True [OK]
Common Mistakes:
MISTAKES
  • Confusing True and False outputs
  • Printing response_time instead of alert
  • Syntax errors in code

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes