λ¬Έμžμ—΄

볡슡문제 λ¬Έμ œ 1주어진 λ¬Έμžμ—΄μ„ μ΄μš©ν•˜μ—¬ 각각의 주석에 ν•΄λ‹Ήν•˜λŠ” μ½”λ“œλ₯Ό μž‘μ„±ν•˜μ‹œμ˜€. address = 'μ„œμšΈμ‹œκ°•λ‚¨κ΅¬μ—­μ‚Όλ™' - city λ³€μˆ˜μ— "μ„œμšΈμ‹œ" λΌλŠ” 값을 μŠ¬λΌμ΄μ‹± ν•˜μ—¬ μ €μž₯ν•˜μ‹œμ˜€ - gu λ³€μˆ˜μ— "강남ꡬ" λΌλŠ” 값을 μŠ¬λΌμ΄μ‹± ν•˜μ—¬ μ €μž₯ν•˜μ‹œμ˜€- dong λ³€μˆ˜μ— "역삼동" μ΄λΌλŠ” 값을 μŠ¬λΌμ΄μ‹± ν•˜μ—¬ μ €μž₯ν•˜μ‹œμ˜€ μœ„ 쑰건을 끝마치면 city , gu, dong λ³€μˆ˜λ₯Ό 좜λ ₯ν•˜μ‹œμ˜€  μ •λ‹΅) address = 'μ„œμšΈμ‹œκ°•λ‚¨κ΅¬μ—­μ‚Όλ™'city = address[0:3:1]print(city)gu = address[3:6:1]print(gu)dong = address[6:9:1]print(dong) μΆœλ ₯κ²°κ³Ό) λ¬Έμ œ 2주어진 λ¬Έμžμ—΄μ„ μ΄μš©ν•˜μ—¬ 각각의 주석에 ν•΄λ‹Ήν•˜λŠ” μ½”λ“œλ₯Ό μž‘μ„±ν•˜μ‹œμ˜€ alphabet = 'abcde..
μ‘μš© 예제 λ¬Έμ œ 15자리둜 κ΅¬μ„±λœ ν•™λ²ˆ '31025'λ₯Ό ν•™λ…„, 반, 번호둜 λ‚˜λˆ„μ–΄ 좜λ ₯ν•˜λŠ” ν”„λ‘œκ·Έλž¨μ„ κ΅¬ν˜„ν•˜μ„Έμš”. # μ‹€ν–‰ 예) 3 ν•™λ…„ 10반 25번 μ •λ‹΅) # Q1studentNum = '31025'# 인덱싱과 μŠ¬λΌμ΄μ‹±μ„ ν™œμš©print(studentNum[0],"ν•™λ…„",studentNum[1:3:1],"반",studentNum[3:5],"번") μΆœλ ₯κ²°κ³Ό) λ¬Έμ œ 2μ°¨λŸ‰λ²ˆν˜Έμ—μ„œ 뒀에 숫자 4자리만 좜λ ₯ν•˜λŠ” ν”„λ‘œκ·Έλž¨μ„ κ΅¬ν˜„ν•˜μ„Έμš”.μ°¨λŸ‰λ²ˆν˜ΈλŠ” 'μ„œμšΈ2κ°€1234' μž…λ‹ˆλ‹€. # μ‹€ν–‰ 예)μ„œμšΈ2κ°€1234의 μ°¨λŸ‰λ²ˆν˜Έ 4μžλ¦¬λŠ” 1234μž…λ‹ˆλ‹€. μ •λ‹΅) # Q2 carNum = 'μ„œμšΈ2κ°€1234'print(carNum+"의 μ°¨λŸ‰λ²ˆν˜Έ 4μžλ¦¬λŠ”",carNum[4:]+"μž…λ‹ˆλ‹€.")print(carNum+"의 μ°¨λŸ‰λ²ˆν˜Έ 4μžλ¦¬λŠ”"..
kukimisgood
'λ¬Έμžμ—΄' νƒœκ·Έμ˜ κΈ€ λͺ©λ‘