Consider a scenario where you need to check if neither 'a' nor 'b' are true in Python. Which of the following operators would you primarily use?

  • a and b
  • a or b
  • not (a or b)
  • not a and not b
To check if neither 'a' nor 'b' are true, you would use the 'not' operator before both 'a' and 'b'. The expression 'not a and not b' ensures that both 'a' and 'b' are not true.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *