Fun Conditionals Quiz!!

JavaScript Conditionals Quiz

  1. Which of the following is the comparison operator for ‘strict equality’ in JavaScript?
    • (a) ==
    • (b) ===
    • (c) !=
  2. Which logical operator checks if both conditions are true?
    • (a) ||
    • (b) &&
    • (c) !
  3. What will be the result of this expression: 5 < 8 && 7 > 6?
    • (a) true
    • (b) false
  4. When is the else block executed in JavaScript?
    • (a) When the if condition is true
    • (b) When the if condition is false
    • (c) When the else if condition is true
  5. What does this statement do: if (x > 10 && y < 5)?
    • (a) It checks if both x is greater than 10 and y is less than 5
    • (b) It checks if either x is greater than 10 or y is less than 5
    • (c) It will always return true ```

Python Conditionals Quiz

  1. Which of the following is the relational operator for ‘greater than’?
    • (a) >
    • (b) <
    • (c) =
  2. Which logical operator checks if both conditions are true?
    • (a) or
    • (b) and
    • (c) not
  3. What will be the result of this expression: 5 < 8 and 7 > 6?
    • (a) True
    • (b) False
  4. When is the else block executed?
    • (a) When the if condition is true
    • (b) When the if condition is false
    • (c) When the elif condition is true
  5. What does this statement do: if x > 10 and y < 5:?
    • (a) It checks if both x is greater than 10 and y is less than 5
    • (b) It checks if either x is greater than 10 or y is less than 5
    • (c) It will always return True