What's Your Name? | HackerRank
What's Your Name? | HackerRank
Python string practice: Print your name in the console.
www.hackerrank.com
Goal
You are given the firstname and lastname of a person on two different lines.
Your task is to read them and print the following:
Hello firstname lastname! You just delved into python.
Solution
This problem is to check you can read parameters from function and print with parameter values.
There are several ways to output formatting.
# What's Your Name?
#
# 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
answer = "Hello {} {}! You just delved into python.".format(first, last)
print(answer)
if __name__ == '__main__':
first_name = input()
last_name = input()
print_full_name(first_name, last_name)
'software Engineering > (Python)HackerRank' 카테고리의 다른 글
[Python] HackerRank - Find a string (0) | 2023.02.15 |
---|---|
[Python] HackerRank - Mutations (0) | 2023.02.14 |
[Python] HackerRank - String Split and Join (0) | 2023.02.07 |
[Python] HackerRank - sWAP cASE (0) | 2023.02.03 |
[Python] HackerRank - Lists (0) | 2023.02.02 |