관리 메뉴

솜씨좋은장씨

[BaekJoon] 4072번 : Words (Python) 본문

Programming/코딩 1일 1문제

[BaekJoon] 4072번 : Words (Python)

솜씨좋은장씨 2023. 1. 21. 16:51
728x90
반응형

코딩 1일 1문제! 오늘의 문제는 백준의 Words 입니다.

 

4072번: Words

Input will consist of a number of lines, each containing up to 250 characters. Words will be separated by single spaces, i.e. not by tabs, double spaces or other characters. Words may be of any length. Input will be terminated by a line containing a single

www.acmicpc.net

👨🏻‍💻 코드 ( Solution )

def words_func(string):
    words = [word[::-1] for word in string.split()]
    
    return " ".join(words)
    

if __name__ == "__main__":
    while True:
        string = input()
        
        if string == "#":
            break
            
        print(words_func(string=string))
 

GitHub - SOMJANG/CODINGTEST_PRACTICE: 1일 1문제 since 2020.02.07

1일 1문제 since 2020.02.07. Contribute to SOMJANG/CODINGTEST_PRACTICE development by creating an account on GitHub.

github.com

 

Comments