>> False >> ‘No’
>>True >> ‘Yes’
Solutions:
1
def bool_to_word(boolean): return "Yes" if boolean else "No"
2
def bool_to_word(boolean): return ['No', 'Yes'][boolean]
def bool_to_word(boolean): return ['No', 'Yes'][boolean] bool_to_word(False) >>'No'
原创文章,作者:306829225,如若转载,请注明出处:https://blog.ytso.com/273393.html