MapleStory Finger Point

๐Ÿƒ‍โ™‚๏ธBaekjoon/Python

#1152 #2908 - python

HYEJU01 2024. 4. 16. 18:36

๋ฐฉ๋ฒ• 1

print(len(input().split()))

 

๋ฐฉ๋ฒ• 2

S = input()
tmp = []
tmp = S.split()
print (len(tmp))

 

๐Ÿ’ฌ split() : split() ํ•จ์ˆ˜๋Š” ๊ณต๋ฐฑ์„ ๊ธฐ์ค€์œผ๋กœ ๊ฐ’์„ ๋ถ„๋ฆฌํ•˜์—ฌ ๋ฆฌ์ŠคํŠธ๋กœ ๋ฐ˜ํ™˜ํ•˜๋Š”๋ฐ ์ด๊ฑธ ์ด์šฉํ•ด์„œ

๐Ÿ’ฌ len() : ํ•ด๋‹น ๋ฆฌ์ŠคํŠธ์˜ ๊ฐ’์„ len() ํ•จ์ˆ˜๋กœ ๋ฝ‘์•„์ฃผ๋ฉด ๋ฌธ์ž์—ด์˜ ๋‹จ์–ด ๊ฐœ์ˆ˜๋ฅผ ์•Œ์•„๋‚ผ ์ˆ˜ ์žˆ๋‹ค.


A,B = input().split()
tmp = []
i = 1
# 123  0,1,2 = 3
A = A[::-1]
B = B[::-1]

if A > B :
    print (A)
else :
    print (B)

 

๐Ÿ’ฌ[::-1] ์Šฌ๋ผ์ด์‹ฑ์„ ์‚ฌ์šฉํ•ด ๋ฌธ์ž์—ด์„ ๊ฑฐ๊พธ๋กœ ๋งŒ๋“ค์–ด์ค€๋‹ค.