반응형
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'}"
반응형
'나는 이렇게 학습한다 > Algorithm & SQL' 카테고리의 다른 글
0201. Who ate the cookie? (0) | 2023.02.01 |
---|---|
0131. You only need one - Beginner (0) | 2023.02.01 |
0129. Super Duper Easy (0) | 2023.01.29 |
0128. Gauß needs help! (Sums of a lot of numbers). (0) | 2023.01.28 |
0127. Remove the time (0) | 2023.01.28 |