코딩코딩코딩

백준(BAEKJOON) 1052 단어의 개수 본문

파이썬/Algorithms

백준(BAEKJOON) 1052 단어의 개수

hanshow113 2021. 1. 15. 11:00

#1

stc = input().split()

print(len(stc))



#2

stc = input()

words = stc.strip().split()

print(len(words))



#3 오답

stc = input()

words = stc.strip().split(" ")

print(len(words))

 

split()은 default parameter가 whitespace임

 

 

 

 

Comments