Guidelines

λ³€μˆ˜μ— 값을 ν• λ‹Ήν•  λ•Œ μ£Όμ˜ν•  점

ν”„λ‘œκ·Έλž˜λ°μ—μ„œ ν• λ‹Ή(Assignment)은 μ„ μ–Έλœ λ³€μˆ˜μ— νŠΉμ •ν•œ 값을 μ €μž₯ν•˜λŠ” 과정을 λœ»ν•©λ‹ˆλ‹€.

예λ₯Ό λ“€μ–΄ x = 5λŠ” xλΌλŠ” λ³€μˆ˜μ— 5λΌλŠ” 값을 μ €μž₯ν•©λ‹ˆλ‹€.

이전 μˆ˜μ—…μ—μ„œ 닀룬 μ΄ˆκΈ°ν™”(Initialization)λŠ” μ„ μ–Έλœ λ³€μˆ˜μ— 값을 ν• λ‹Ήν•˜λŠ” 과정을 μ˜λ―Έν•©λ‹ˆλ‹€.


μ£Όμ˜μ‚¬ν•­

ν”„λ‘œκ·Έλž˜λ°μ—μ„œ = κΈ°ν˜ΈλŠ” μˆ˜ν•™μ²˜λŸΌ "κ°™λ‹€"λŠ” μ˜λ―Έκ°€ μ•„λ‹Œ, 였λ₯Έμͺ½μ˜ 값을 μ™Όμͺ½μ˜ λ³€μˆ˜μ— ν• λ‹Ήν•œλ‹€λŠ” μ˜λ―Έμž…λ‹ˆλ‹€.

λ³€μˆ˜ ν• λ‹Ή μ˜ˆμ‹œ
number = 10 message = "Hello, Python!"

μœ„ μ½”λ“œμ—μ„œ number = 10은 numberλΌλŠ” λ³€μˆ˜μ— 10μ΄λΌλŠ” 숫자λ₯Ό ν• λ‹Ήν•˜λŠ” 것을 μ˜λ―Έν•©λ‹ˆλ‹€.

λ§ˆμ°¬κ°€μ§€λ‘œ message = "Hello, Python!"은 messageλΌλŠ” λ³€μˆ˜μ— "Hello, Python!"μ΄λΌλŠ” λ¬Έμžμ—΄μ„ ν• λ‹Ήν•©λ‹ˆλ‹€.

"κ°™λ‹€"λΌλŠ” 의미둜 λ“±ν˜Έλ₯Ό μ‚¬μš©ν•  κ²½μš°μ—λŠ” ==와 같이 λ“±ν˜Έ 2개λ₯Ό μ‚¬μš©ν•©λ‹ˆλ‹€.

λ“±ν˜Έλ₯Ό 'κ°™λ‹€'λŠ” 의미둜 μ‚¬μš©ν•˜λŠ” 경우
if number == 10: print("numberλŠ” 10μž…λ‹ˆλ‹€.")

λ³€μˆ˜ μž¬ν• λ‹Ή

νŒŒμ΄μ¬μ—μ„œλŠ” 이미 ν• λ‹Ήλœ λ³€μˆ˜μ— μƒˆλ‘œμš΄ 값을 ν• λ‹Ήν•  수 μžˆμŠ΅λ‹ˆλ‹€.

μ΄λ•Œ 이전 값은 μž¬ν• λ‹Ήλœ κ°’μœΌλ‘œ λŒ€μ²΄λ©λ‹ˆλ‹€.

λ³€μˆ˜ μž¬ν• λ‹Ή μ˜ˆμ‹œ
number = 10 # λ³€μˆ˜ number에 κ°’μœΌλ‘œ 10 ν• λ‹Ή number = 15 # μ²˜μŒμ— 10μ΄μ—ˆλ˜ number에 15λ₯Ό μƒˆλ‘œμš΄ κ°’μœΌλ‘œ ν• λ‹Ή

닀쀑 ν• λ‹Ή

νŒŒμ΄μ¬μ—μ„œλŠ” ν•œ 쀄에 μ—¬λŸ¬ λ³€μˆ˜μ˜ 값을 λ™μ‹œμ— ν• λ‹Ήν•  수 μžˆμŠ΅λ‹ˆλ‹€.

닀쀑 ν• λ‹Ή μ˜ˆμ‹œ
x, y, z = 5, 10, 15 print(x) # 5 print(y) # 10 print(z) # 15

μ½”λ”© μ‹€μŠ΅

λ³€μˆ˜ student_name의 값을 μž¬ν• λ‹Ή ν•΄λ³΄μ„Έμš”.

Mission
0 / 1

λ³€μˆ˜μ— 값을 ν• λ‹Ήν•  λ•Œ λ“±ν˜Έ(=)λŠ” μ–΄λ–€ 의미λ₯Ό κ°€μ§ˆκΉŒμš”?

ν”„λ‘œκ·Έλž˜λ°μ—μ„œ '=' κΈ°ν˜ΈλŠ” μˆ˜ν•™μ²˜λŸΌ 'κ°™λ‹€'λŠ” μ˜λ―Έκ°€ μ•„λ‹Œ, 였λ₯Έμͺ½μ˜ 값을 λŠ” μ˜λ―Έμž…λ‹ˆλ‹€.
λΉ„κ΅ν•œλ‹€
λ”ν•œλ‹€
μ™Όμͺ½μœΌλ‘œ μ΄λ™ν•œλ‹€
μ™Όμͺ½μ˜ λ³€μˆ˜μ— ν• λ‹Ήν•œλ‹€

Guidelines

AI Tutor

Publish

Design

Upload

Notes

Favorites

Help

Code Editor

Run
Generate

Execution Result