Tinkerbell Glitter
[241212] ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์ž…๋ฌธ ๋ฌธ์ œ
ยท
[๋‚ด๋ฐฐ์บ ] ๋ณธ ์บ ํ”„ (24.11.25 ~ 25.03.01) ๐Ÿƒ๐Ÿป‍โ™€๏ธ/๋ฌธ์ œ ํ’€์ด ๐Ÿ’ฏ
์‚ผ๊ฐํ˜•์˜ ์™„์„ฑ์กฐ๊ฑดQ. ์‚ผ๊ฐํ˜•์˜ ์„ธ ๋ณ€์˜ ๊ธธ์ด๊ฐ€ ๋‹ด๊ธด ๋ฐฐ์—ด `sides` ์ด ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ์ฃผ์–ด์ง‘๋‹ˆ๋‹ค. ์„ธ ๋ณ€์œผ๋กœ ์‚ผ๊ฐํ˜•์„ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋‹ค๋ฉด 1, ๋งŒ๋“ค ์ˆ˜ ์—†๋‹ค๋ฉด 2๋ฅผ return ํ•˜๋„๋ก solution ํ•จ์ˆ˜๋ฅผ ์™„์„ฑํ•ด์ฃผ์„ธ์š”. # ์ฃผ์„์ฒ˜๋ฆฌ ๋œ ์ฝ”๋“œ๋“ค์€ ์ˆ˜์ • ์ „ ๊ธฐ์กด ์ฝ”๋“œ ์ž…๋‹ˆ๋‹ค.def solution(sides): #answer = sides minusdata: return 2 elif in_max ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์— ์žˆ๋˜ ํƒ€์ธ๋“ค์˜ ๋ฌธ์ œํ’€์ด:1.def solution(sides): # ์ปดํ”„๋ฆฌํ•ธ์…˜ return 1 if max(sides)  2.def solution(sides): sides.sort() return 1 if sides[0]+sides[1]>sides[2] els..
[241212] ํŒŒ์ด์ฌ VSCode ๋กœ ๊ฐ€์ƒํ™˜๊ฒฝ ์„ค์ • ๋ฐ ๋ณ€์ˆ˜ ๋ณต์Šต
ยท
[๋‚ด๋ฐฐ์บ ] ๋ณธ ์บ ํ”„ (24.11.25 ~ 25.03.01) ๐Ÿƒ๐Ÿป‍โ™€๏ธ/Python ๐Ÿ“š
์˜ค๋Š˜๋ถ€ํ„ฐ ์ˆ˜์ค€๋ณ„ ๋ถ„๋ฐ˜ ์ˆ˜์—…์„ ์‹œ์ž‘ํ•˜์˜€๋Š”๋ฐ์˜ค๋Š˜ TIL์€ ํ•ด๋‹น ์ˆ˜์—…์˜ ๋‚ด์šฉ์„ ๊ธฐ๋กํ•œ ๊ฒƒ์ž…๋‹ˆ๋‹ค~~ํŒŒ์ด์ฌ VSCode ๋กœ ๊ฐ€์ƒํ™˜๊ฒฝ ์„ค์ • ๋ฐ ๋ณ€์ˆ˜ ๋ณต์Šต์ผ๋‹จ ๊ฐ€์ƒํ™˜๊ฒฝ์„ ๋จผ์ € ๋งŒ๋“ค์–ด ๋ณด๊ฒ ์Œpython -m venv firstmyvenvํ„ฐ๋ฏธ๋„์—์„œ venv(=๊ฐ€์ƒํ™˜๊ฒฝ)๋ฅผ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด์„œ ๋ช…๋ น์–ด๋ฅผ์ž…๋ ฅํ•ด์ค๋‹ˆ๋‹คfirstmyvenv ๋Š” ๊ฐ€์ƒํ™˜๊ฒฝ์— ๋ถ™์—ฌ์ค„ ์ด๋ฆ„์ž„์ด๋ฆ„์€ ์•„๋ฌด๊ฑฐ๋‚˜ ์ง€์–ด๋„ ์ƒ๊ด€Xsource firstmyvenv/bin/activateํ•˜๋ฉด ํ„ฐ๋ฏธ๋„์—์„œ ๊ฐ€์ƒํ™˜๊ฒฝ์ด ์ •์ƒ ๋™์ž‘์„ ์‹œ์ž‘ํ•œ ๊ฒƒsource firstmyvenv/bin/active ํ•˜๋ฉด ์‹คํ–‰์•ˆ๋จ๋ช…๋ น์–ด ์ž˜๋ชป ์ž…๋ ฅํ•ด์„œ ๋™์ž‘์ด ์•ˆ๋จใ…‹ใ…‹๊ทธ๋ฆฌ๊ณ  bin ์€ ๋งฅ์—์„œ ์“ธ ์ˆ˜ ์žˆ๋Š” ๋ช…๋ น์–ด์ž…๋‹ˆ๋‹ค๊ฐ€์ƒํ™˜๊ฒฝ์ด ์ •์ƒ๋™์ž‘ ํ•˜๋ฉด์ด๋ ‡๊ฒŒ ๋ฌธ๊ตฌ ์˜†์— ํŒŒ๋ž€ ๋ถˆ์ด ๋“ค์–ด์˜ด์ž‘๋™ ์‹คํ—˜์„ ์œ„ํ•ด์„œ pip insta..
[241211] ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์ž…๋ฌธ ๋ฌธ์ œ
ยท
[๋‚ด๋ฐฐ์บ ] ๋ณธ ์บ ํ”„ (24.11.25 ~ 25.03.01) ๐Ÿƒ๐Ÿป‍โ™€๏ธ/๋ฌธ์ œ ํ’€์ด ๐Ÿ’ฏ
๋‚˜์ด ์ถœ๋ ฅํ•˜๊ธฐQ. ๋จธ์“ฑ์ด๋Š” ์„ ์ƒ๋‹˜์ด ๋ช‡ ๋…„๋„์— ํƒœ์–ด๋‚ฌ๋Š”์ง€ ๊ถ๊ธˆํ•ด์กŒ์Šต๋‹ˆ๋‹ค. 2022๋…„ ๊ธฐ์ค€ ์„ ์ƒ๋‹˜์˜ ๋‚˜์ด age ๊ฐ€ ์ฃผ์–ด์งˆ ๋•Œ,์„ ์ƒ๋‹˜์˜ ์ถœ์ƒ ์—ฐ๋„๋ฅผ return ํ•˜๋Š” solution ํ•จ์ˆ˜๋ฅผ ์™„์„ฑํ•ด์ฃผ์„ธ์š”.A.def solution(age): answer = 0 answer = 2022 - age while age: answer += 1 return answer ์ฒ˜์Œ์— ์ฝ”๋“œ๋ฅผ ์งฐ์„ ๋•Œwhile๋ฌธ์„ ์‚ฌ์šฉํ•˜์—ฌ์„œ ์ฝ”๋“œ๋ฅผ ์งœ๋ดค๋Š”๋ฐ,๋ญ”๊ฐ€ if๋ฌธ์œผ๋กœ๋„ ์ฝ”๋“œ ์งœ๋ณผ ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์•„์„œif๋ฌธ ์ฝ”๋“œ๋„ ๋“ค๊ณ ์™€๋ด„def solution(age): answer = 0 answer = 2022 - age if age == age: answer += 1 r..
[241211] git ๋ช…๋ น์–ด์™€ ๊ฐœ๋… ํŠน๊ฐ• ๋‚ด์šฉ ์ •๋ฆฌ
ยท
[๋‚ด๋ฐฐ์บ ] ๋ณธ ์บ ํ”„ (24.11.25 ~ 25.03.01) ๐Ÿƒ๐Ÿป‍โ™€๏ธ/git โŒจ๏ธ
git ๋ช…๋ น์–ด์™€ ๊ฐœ๋… ํŠน๊ฐ• ๋‚ด์šฉ ์ •๋ฆฌ~git ์ง€๋‚œ ์‹œ๊ฐ„ ํŠน๊ฐ• ๋ณต์Šต์ž…๋‹ˆ๋‹ค~๊ฐ„๋‹จํ•œ Linux ๋ช…๋ น์–ด ์•Œ์•„๋ณด๊ธฐls : ํ˜„์žฌ ์œ„์น˜์˜ ํด๋”, ํŒŒ์ผ ๋ชฉ๋ก ๋ณด๊ธฐls -al : ํ˜„์žฌ ์œ„์น˜์˜ ์ˆจ๊น€ ํŒŒ์ผ์„ ํฌํ•จํ•˜์—ฌ ๋ณด๊ธฐpwd : ํ˜„์žฌ ์œ„์น˜ ๋ณด๊ธฐcd /๊ฒฝ๋กœ/ : ํ˜„์žฌ ์œ„์น˜๋ฅผ /๊ฒฝ๋กœ/ ๋กœ ์ด๋™ํ•˜๊ธฐcd .. : ์ƒ์œ„ ํด๋”(๊ฒฝ๋กœ)๋กœ ์ด๋™mkdir {ํด๋”์ด๋ฆ„} : ํด๋” ์ƒ์„ฑํ•˜๊ธฐtouch {ํŒŒ์ผ์ด๋ฆ„} : ํŒŒ์ผ ์ƒ์„ฑํ•˜๊ธฐrm {ํŒŒ์ผ์ด๋ฆ„} : ํŒŒ์ผ ์‚ญ์ œํ•˜๊ธฐrm -r {ํด๋”์ด๋ฆ„} : ํด๋” ์‚ญ์ œํ•˜๊ธฐgit init ์€ ์ €์žฅ์†Œ๋ฅผ ์ง€์ •ํ•ด์ฃผ๋Š” ๋ช…๋ น์–ด์ด๋‹คํ•œ ๋ฒˆ ์„ค์ •ํ•˜๋ฉด ํ•ด๋‹น ํด๋”์™€ ํ•˜์œ„ ํด๋” ๊นŒ์ง€ git์ด ๊ด€๋ฆฌ๋ฅผ์‹œ์ž‘ํ•œ๋‹ค๊ณ  ๋ณด๋ฉด ๋จโ€ปgit init ์„ ํ•˜๊ณ  ๋‚˜์„œ ๋˜‘๊ฐ™์€ ์ €์žฅ์†Œ์—์„œ ํ•œ ๋ฒˆ ๋”git init ์„ ์ž…๋ ฅํ•ด์ค„ ๊ฒฝ์šฐ ์ €์žฅ์†Œ๊ฐ€ ์ดˆ๊ธฐํ™” ๋ฉ๋‹ˆ๋‹ค.โ€ป์ด๊ฒŒ..
[241210] ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์ž…๋ฌธ ๋ฌธ์ œ
ยท
[๋‚ด๋ฐฐ์บ ] ๋ณธ ์บ ํ”„ (24.11.25 ~ 25.03.01) ๐Ÿƒ๐Ÿป‍โ™€๏ธ/๋ฌธ์ œ ํ’€์ด ๐Ÿ’ฏ
1. ๋ถ„์ˆ˜์˜ ๋ง์…ˆQ. ์ฒซ๋ฒˆ์งธ ๋ถ„์ˆ˜์˜ ๋ถ„์ž์™€ ๋ถ„๋ชจ๋ฅผ ๋œปํ•˜๋Š” numer1, denom1, ๋‘๋ฒˆ์งธ ๋ถ„์ˆ˜์˜ ๋ถ„์ž์™€ ๋ถ„๋ชจ๋ฅผ ๋œปํ•˜๋Š” numer2, denom2 ๊ฐ€ ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ์ฃผ์–ด์ง‘๋‹ˆ๋‹ค. ๋‘ ๋ถ„์ˆ˜๋ฅผ ๋”ํ•œ ๊ฐ’์„ ๊ธฐ์•ฝ ๋ถ„์ˆ˜๋กœ ๋‚˜ํƒ€๋‚ด์—ˆ์„ ๋•Œ, ๋ถ„์ž์™€ ๋ถ„๋ชจ๋ฅผ ์ˆœ์„œ๋Œ€๋กœ ๋‹ด์€ ๋ฐฐ์—ด์„ return ํ•˜๋„๋ก solution ํ•จ์ˆ˜๋ฅผ ์™„์„ฑํ•ด๋ณด์„ธ์š”.A. ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค๋Š” ๋ชจ๋“ˆ ์ ์šฉ์ด ์•ˆ๋˜๋‹ˆ๊นŒ ์ผ์ผ์ด ๊ตฌํ˜„์„ ํ•ด์ค˜์•ผ ํ•˜๋Š”๋ฐ,์–ด๋–ป๊ฒŒ ํ•ด์ค˜์•ผ ํ•˜๋Š”์ง€ ๋ชจ๋ฅด๋‹ˆ๊นŒ ์ผ๋‹จ ๋ณด๋ผ์„ ์ƒํ•œํ…Œ ๋ฌผ์–ด๋ด์„œ ์–ป์€ ์ฝ”๋“œ๋ฅผ ๋ฐ๋ ค์™€๋ดค์Šต๋‹ˆ๋‹ค.def gcd(a, b): while b: a, b = b, a % b return adef lcm(a, b): return a * b // gcd(a, b)def solution(numer1, denom1, nu..