μλ‘ λ€λ₯Έ νμ μ μ°μ°μΌλ‘ μΈν TypeError
TypeError
λ μ£Όλ‘ μ«μμ λ¬Έμμ΄, λλ λ€λ₯Έ νΈνλμ§ μλ λ°μ΄ν° νμ
λ€ μ¬μ΄μ μ°μ°μ μλν λ λ°μν©λλ€.
μλ₯Ό λ€μ΄, μλμ κ°μ΄ λ¬Έμμ΄(apple
)κ³Ό μ«μ(ten
)λ₯Ό λνλ©΄ TypeError
κ° λ°μν©λλ€.
TypeError μμ
ten = 10 apple = "μ¬κ³Ό" result = apple + ten # TypeError: unsupported operand type(s) for +: 'int' and 'str'
TypeError μ²λ¦¬ λ°©λ²
TypeError
λ₯Ό λ°©μ§νκΈ° μν΄μλ μ°μ°μ μννκΈ° μ μ λ°μ΄ν° νμ
μ μΌμΉμν€κ±°λ, μ μ ν λ³νμ μνν΄μΌ ν©λλ€.
λ°μ΄ν° νμ
λ³ν μμ
number = 10 text = "μ¬κ³Ό" result = str(number) + text # '10μ¬κ³Ό'
Mission
0 / 1
μλ‘ λ€λ₯Έ λ°μ΄ν° νμ κ°μ μ°μ°μ μλν λλ νμ TypeErrorκ° λ°μνλ€.
O
X
Guidelines
AI Tutor
Publish
Design
Upload
Notes
Favorites
Help
Code Editor
Run
Generate
Execution Result