MapleStory Finger Point

๐Ÿ’Ž Python 60

๋ฌธ์ž์—ด ๋ฌธ์ž์˜ ๋ฐœ์ƒ ๋นˆ๋„ ์„ธ๊ธฐ - ํŒŒ์ด์ฌ for Beginner (2ํŒ)

๋”•์…”๋„ˆ๋ฆฌ = ๋นˆ๋„์ˆ˜ ๊ธฐ๋ก ๋ฆฌ์ŠคํŠธ = ์ •๋ ฌํ•  ํŠœํ”Œ๋ฆฌ์ŠคํŠธ ์ฒ˜์Œ์€ for ๋ฌธ์„ ํ†ตํ•ด์„œ ์›๋ฌธ์„ ๋ฌธ์ž ํ•˜๋‚˜์”ฉ ์ฝ์–ด์™€์„œ ๋”•์…”๋„ˆ๋ฆฌ ๊ฐ’์— ๋ˆ„์ ์‹œ์ผœ์ค€๋‹ค. ch ๊ธ€์”จ๊ฐ€ ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๋Š” ๋ฌธ์žฅ => ch in countDic =>True False ๋”•์…”๋„ˆ๋ฆฌ๋ฅผ ์ •๋ ฌํ•ด์ค€๋‹ค . ํŠœํ”Œ -> ๋ฆฌ์ŠคํŠธ๋กœ ๋ณ€ํ™˜ ๋ฆฌ์ŠคํŠธ [a][b] a ์—๋Š” ๋ฌธ์ž b ๋Š” ๋นˆ๋„ ์ˆ˜ ๊ฐ€ ์ €์žฅ๋˜์–ด์žˆ์œผ๋ฏ€๋กœ ์ถœ๋ ฅ. import operator inStr = '''๋‚ด๊ฐ€ ๋‚ด๊ฐ€.. ๋‚ด๊ฐ€ ๊ทธ ์ด๋ฆ„์„ ๋ถˆ๋ €์„๋•Œ ๋‚ด๊ฐ€ ๊ทธ ๋ญ์ง€ .. ์ด๋ฆ„์„ ๋ถˆ๋ €๋‚˜ ๋‚ด๊ฐ€ ๊ทธ ์ด๋ฆ„์„ ์žŠ๊ณ ์žˆ์—ˆ๋‚˜ ๋‚ด๊ฐ€ ์ด๋ฆ„์„ ๋ถˆ๋ €๋‹ค๊ฐ€ ๋ง์•˜๋‹ค๊ฐ€ ์ด๋ฆ„์„...''' countDic = {} countList = [] if __name__ == "__main__": for ch in inStr : if 'ใ„ฑ'

๋Œ€์†Œ๋ฌธ์ž ์ƒํ˜ธ ๋ณ€ํ™˜ํ•˜๊ธฐ - ํŒŒ์ด์ฌ for Beginner (2ํŒ)

swapcase() ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ  ๋ณ€ํ™˜ํ•˜๋Š” ์ฝ”๋“œ๋‹ค. lower ๊ณผ upper ์€ ๋ฌธ์ž ํ•˜๋‚˜์”ฉ ์ถ”์ถœํ•ด์„œ ๋ณ€ํ™˜ํ•ด์•ผํ•œ๋‹ค. ์กฐ๊ฑด๋ฌธ์„ ํ†ตํ•ด ๋Œ€๋ฌธ์ž๋ฉด lower ์†Œ๋ฌธ์ž๋ฉด upper ๊ฐ€ ์‹คํ–‰๋˜๋„๋ก ํ•œ๋‹ค. ๋Œ€์†Œ๋ฌธ์ž๋„ ์•„๋‹ˆ๋ฉด ๊ทธ๋Œ€๋กœ ์ถœ๋ ฅ. inStr, outStr = "", "" ch = "" count, i = 0,0 if __name__ == "__main__" : inStr = input("๋ฌธ์ž์—ด ์ž…๋ ฅ =>") count = len(inStr) for i in range (0,count) : ch = inStr[i] if (ord(ch)>=ord("A") and ord(ch) =ord("a") and ord(ch)

ch 8 ์—ฐ์Šต๋ฌธ์ œ ํ’€์ด - ํŒŒ์ด์ฌ for Beginner (2ํŒ)

1) ์ถœ๋ ฅ ๋‚ด์šฉ ์˜ˆ์ธก ss = "python" ss[0] (0 ์ถœ๋ ฅ) p ss[1:2] (1๋ถ€ํ„ฐ 1๊นŒ์ง€) y ss[-3:-1] (๋’ค์—์„œ 3๋ฒˆ์งธ~ 2๋ฒˆ์งธ ) ho ss[3:] (3 ๋ถ€ํ„ฐ ๋๊นŒ์ง€) hon 2) ์˜ค๋ฅ˜ ๋ฐœ์ƒํ•˜๋Š” ๊ฒƒ ๊ณ ๋ฅด์‹œ์˜ค ss1 = 'Python' ss2 = 'Good' 2๋ฒˆ 4๋ฒˆ ๋ฌธ์ž์—ด๋ผ๋ฆฌ - , / ์—ฐ์‚ฐ์€ ๋ถˆ๊ฐ€๋Šฅํ•˜๋‹ค. 3) ๋นˆ์นธ์ฑ„์šฐ๊ธฐ :: ๋ฌธ์ž์—ด ์ค‘๊ฐ„๋งˆ๋‹ค $ ๋„ฃ๊ธฐ ss = 'Python' for i in range(0,len(ss)) : print(ss[i]+"$",end='') 4) ๋นˆ์นธ์ฑ„์šฐ๊ธฐ :: ๋ฌธ์ž์—ด ๋ฐ˜๋Œ€ ์ˆœ์„œ๋กœ ์ถœ๋ ฅ inStr, outStr = "Python", "" strLen = len(inStr) for i in range(0,strLen): outStr += inStr[0-..

๊ธ€์ž,์ˆซ์ž,๊ธ€์ž+์ˆซ์ž ๋“ฑ๋“ฑ ๋ฌธ์ž์—ด ํŒ๋ณ„ ํ”„๋กœ๊ทธ๋žจ - ํŒŒ์ด์ฌ for Beginner (2ํŒ)

ss = input("๋ฌธ์ž์—ด ์ž…๋ ฅ == >") if ss.isdigit() == True : print("์ˆซ์ž์ž…๋‹ˆ๋‹ค") elif ss.isalpha() == True : print("๊ธ€์ž์ž…๋‹ˆ๋‹ค") elif ss.isalnum() == True : print("์ˆซ์ž+๊ธ€์ž์ž…๋‹ˆ๋‹ค") else : print('๋ชจ๋ฅด๊ฒŒ์จ์šฉ')

๋ฌธ์ž์—ด ์ค‘๊ฐ„์˜ ๊ณต๋ฐฑ ์‚ญ์ œ ํ•˜๊ธฐ - ํŒŒ์ด์ฌ for Beginner (2ํŒ)

inStr = " ํ•œ๊ธ€ python ํ”„๋กœ๊ทธ๋ž˜๋ฐ ~ " outStr ="" for i in range(0,len(inStr)) : if inStr[i] != ' ': outStr += inStr[i] print("์›๋ž˜ ๋ฌธ์ž์—ด ==> " + '[' + inStr + ']' ) print("๊ณต๋ฐฑ ์‚ญ์ œ ๋ฌธ์ž์—ด ==> " + '[' + outStr + ']' )