나는 이렇게 학습한다/Algorithm & SQL

0130. Grasshopper - Personalized Message

daco2020 2023. 1. 31. 00:18
반응형

Create a function that gives a personalized greeting. This function takes two parameters: name and owner.

Use conditionals to return the proper message:

case

name equals owner : 'Hello boss' otherwise : 'Hello guest'



Solution:

def greet(name: str, owner: str) -> str:
    return f"Hello {name == owner and 'boss' or 'guest'}"


반응형