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

1231. For UFC Fans (Total Beginners): Conor McGregor vs George Saint Pierre

daco2020 2022. 12. 31. 15:18
반응형

This is a beginner friendly kata especially for UFC/MMA fans.

It's a fight between the two legends: Conor McGregor vs George Saint Pierre in Madison Square Garden. Only one fighter will remain standing, and after the fight in an interview with Joe Rogan the winner will make his legendary statement. It's your job to return the right statement depending on the winner!

If the winner is George Saint Pierre he will obviously say:

  • "I am not impressed by your performance."

If the winner is Conor McGregor he will most undoubtedly say:

  • "I'd like to take this chance to apologize.. To absolutely NOBODY!"

Good Luck!

Note

The given name may varies in casing, eg., it can be "George Saint Pierre" or "geOrGe saiNT pieRRE". Your solution should treat both as the same thing (case-insensitive).



Solution:

def quote(fighter: str) -> str:
    return {
        "george saint pierre" : "I am not impressed by your performance.",
        "conor mcgregor" : "I'd like to take this chance to apologize.. To absolutely NOBODY!"
    }[fighter.lower()]


반응형

'나는 이렇게 학습한다 > Algorithm & SQL' 카테고리의 다른 글

0102. Enumerable Magic #25 - Take the First N Elements  (0) 2023.01.03
0101. Pillars  (0) 2023.01.01
1230. The Wide-Mouthed frog!  (0) 2022.12.30
1229. Parts of a list  (0) 2022.12.30
1228. Kata Example Twist  (0) 2022.12.28