Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def mutually_exclusive(values) -> bool:
- """
- Return True if only one value in values is True.
- In all other cases, False is returned.
- """
- result = False
- for value in values:
- if not result and value:
- result = True
- elif result and value:
- return False
- return result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement