[ 난이도: Easy | 분야: Strings ]
다른 두 줄에 사람에 대한 성씨와 이름이 있다. 이번 과제에서는 이 정보들을 읽고 아래처럼 출력하는 것이다:
Hello firstname lastname! You just delved into python.
print_full_name 함수를 완성하라.
print_full_name은 아래 파라미터를 가진다:
- string first: 이름
- string last: 성씨
- 문자열: 'Hello firstname lastname! You just delved into python' 양식에서 firstname에는 string first를 lastname에는 string last를 넣어라.
첫 번째 줄은 이름을 가지고 있고 두 번째 줄은 성씨를 가지고 있다.
각 이름과 성씨의 길이는 10보다 작다.
Ross
Taylor
Hello Ross Taylor! You just delved into python.
프로그램에 의해 읽힌 데이터는 문자열로 저장된다. 문자열은 단어들의 집합이다.
#
# Complete the 'print_full_name' function below.
#
# The function is expected to return a STRING.
# The function accepts following parameters:
# 1. STRING first
# 2. STRING last
#
def print_full_name(first, last):
# Write your code here
if __name__ == '__main__':
first_name = input()
last_name = input()
print_full_name(first_name, last_name)
더보기
정답
def print_full_name(first, last):
# Write your code here
result = "Hello " + first +" "+ last +"! You just delved into python."
print(result)
if __name__ == '__main__':
first_name = input()
last_name = input()
print_full_name(first_name, last_name)
©️Hackerrank. All Rights Reserved.