Convert boolean values to strings 'Yes' or 'No'

Complete the method that takes a boolean value and return a "Yes" string for true, or a "No" string for false.

 

bool_to_word(True) # Output: "Yes" 

bool_to_word(False) # Output: "No"

الحل

الحل 1

def boolean_to_string(b):
    
    return "True" if b else "False"

الحل 2

def bool_to_word(boolean):
    # TODO
    if(boolean):
        return 'Yes'
    else:
        return 'No'