Python sample question with answer 13
Question:
Which operator can be used in a condition to evaluate whether the value contained in a login_attempts variable matches a value of 5?
- ==
- =
- >=
- !=
Answer:
A - is the correct answer. The == operator evaluates whether two objects match and can be used in a condition to evaluate whether the value contained in a login_attempts variable matches a value of 5. This condition can be placed in an if statement header as if login_attempts == 5