This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def nessitas_one(iterable): #fixed | |
"""Return the object in the given iterable that evaluates to True. | |
If the given iterable has more than one object that evaluates to True, | |
or if there is no object that fulfills such condition, return None. | |
>>> nessitas_one((True, False, False)) | |
True | |
>>> nessitas_one((True, False, True)) | |
False |