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

1209. Grasshopper - Combine strings

daco2020 2022. 12. 9. 21:20
반응형

Combine strings function

Create a function named (combine_names) that accepts two parameters (first and last name). The function should return the full name.

Example:

combine_names('James', 'Stevens')

returns:

'James Stevens'



Solution:

class Names:
    @staticmethod
    def combine(a, b):
        return " ".join([a, b])

combine_names = Names.combine


반응형

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

1211. Maximum Product  (0) 2022.12.11
1210. Bumps in the Road  (0) 2022.12.11
1208. A Strange Trip to the Market  (0) 2022.12.08
1207. Vowel Count  (0) 2022.12.07
1206. Sum of positive  (0) 2022.12.06