Added Challenge! Control Flow (Advanced) Python Task #2: Same Name

In Learn Python 3, Control Flow (Advanced) Challenges Task #2: Same Name, I got the answer correct. Yet, below the box it says, “If you want an added challenge, you can try shortening the function body to one line of code!”

Tried Googling, and I can’t find any guidance.

How can I do this?

Hi,
Consider what the result of the condition is and the value that is returned in each case.
i.e when your_name == my_name is True, it returns True, and vice versa
so,

return (your_name == my_name)

will work the same.

Hope that helps

1 Like

Makes total sense! Thanks, @pluginmaybe

1 Like