[Coding Training Python] 연습문제 1. 인사하기

연습문제 1. 인사하기

출력 예

What is your name? Brian
Hello, Brian, nice to meet you!

제약 조건

도전 과제


import unittest


def hello_world():

    def _input_name():
        return input('What is your name?')

    def _get_hello_world(name):
        return 'Hello, {name}, nice to meet you!'.format(name=name)

    def _print_hello_world(string):
        return string

    return _print_hello_world(_get_hello_world(_input_name()))


class TestHelloWorld(unittest.TestCase):
    def test_hello_world(self):
        actual = hello_world()
        self.assertEqual(actual, 'Hello, Brian, nice to meet you!')



회고