Testing Truthy or Falsy arguments passed through a function into an if statement
问题 I am drawing a blank on this one too. Rather than provide an answer, I would appreciate if someone could help me understand why my code is not printing the expected output: def bool_to_str(bval): if bval is True: mytest = 'Yes' else: mytest = 'No' return mytest Expected output: >>>bool_to_str([1, 2, 3]) 'Yes' >>>bool_to_str(abcdef) 'Yes' What's actually output: >>>bool_to_str([1, 2, 3]) 'No' >>>bool_to_str(abcdef) 'No' Please help me to understand what I did wrong. I think that the function