Problem 157635 · easy · Phase 01 Prerequisites & Setup

Exactly Two of Three

boolean logic · conditionals

Write exactly_two(a, b, c) that takes three booleans and returns True if exactly two of them are True, and False otherwise (including when all three are True).

Examples

Input:  a = True, b = True, c = False
Output: True

Input:  a = True, b = True, c = True
Output: False

Input:  a = False, b = False, c = True
Output: False

Constraints

  • a, b, c are booleans

Goals

  • Build a compound condition from three booleans
  • Distinguish 'at least two' from 'exactly two'
Starting Python…