λ°μν
4κ°. νμ΄μ¬ μμνκΈ°
- νμ΄μ¬μ νλ νλ‘μΌ(Guido van Rossum)μ μν΄ 1991λ λΆμ° μ΄μ 체μ (μλ©λ°)μ μμ€ν κ΄λ¦¬λ₯Ό μν μ μ€ν¬λ¦½ν μΈμ΄λ‘ κ°λ°λμλ€.
- νΌμ°μ°μμ κΈ°λ³Έμ°μ°μ(+, -, *, /, **)λ₯Ό μ΄μ©ν ννμμ νμ΄μ¬ μΈν°ν리ν°μ μν΄ μλ κ³μ°λλ€.
- νΉμ μμ μ μννλ μ½λμ μ§ν©μΌλ‘ ν¨μμ μ΄λ¦λ§μΌλ‘ μ€νν μ μλ λ¨μλ₯Ό ν¨μλΌκ³ νλ€.
- νμ΄μ¬μ λ€μ¬μ°κΈ°μ μμ‘΄μ μΈμ΄μ΄λ©° μ½λμ λ Όλ¦¬μ μ§ν©μΈ λΈλ‘μ νννλλ° μ¬μ©λλ€.
- μ£Όμμ κ°λ° μλ ν₯μμν€κ³ μ μ§λ³΄μλ₯Ό μ©μ΄νκ² νλ μ€μν μ€λͺ μ΄λ€. μ£Όμμ #κ³Ό """μ μ¬μ©νλ€.
- μ²λ¦¬ν λ°μ΄ν°μ μ²λ¦¬λ κ²°κ³Όμ μμμ μ μ₯μ λ³μκ° μ¬μ©λλ©° ν λΉμ°μ°μμ μΌμͺ½μ μ μνλ€.
- μλ³μλ νλ‘κ·Έλ¨ λ΄λΆμ μ μλ κ°μ²΄(λ³μ, ν¨μ λ±)μ μ΄λ¦μ΄λ€.
- νλ‘κ·Έλλ° μΈμ΄μμλ§ μ¬μ©λλ μ°μ μ°μ°μλ‘ μ μ λλμ μ°μ°μ(//)μ λͺ¨λλ‘ μ°μ°μ(%)κ° μλ€.
- μ°μ°μ μ°μ μμλ ννμμ μ¬μ©λ μ¬λ¬ μ°μ°μμ μ°μ° μμλ₯Ό κ²°μ νλ€.
μ°μ΅λ¬Έμ 4κ°. νμ΄μ¬ μμνκΈ°
λ¬Έμ 1. λ€μκ³Ό κ°μ μ€ν κ²°κ³Όλ₯Ό μ»κΈ° μν νμ΄μ¬ μ½λλ‘ μ¬λ°λ₯Έ κ²μ?
[κ²°κ³Ό]
Computer science is the best
Our goal is to predict the future
1) 2) 3) 4) |
print("Computer science is the best") print("Our goal is to predict the future") print("Computer science is the best") print("Our goal is to predict the future") print(Computer science is the best) print(Our goal is to predict the future) "Computer science is the best" "Our goal is to predict the future" |
λ¬Έμ 2. λ€μ μ€ μλ³μλ‘ μ¬μ©ν μ μλ κ²μ? μ λ΅νμΈ

1) _pythonic 2) graudate130 3) 270mm 4) λΆνΌ |
λ¬Έμ 3. λ€μ νλ‘κ·Έλ¨μ μ€ν κ²°κ³Όλ‘ μ¬λ°λ₯Έ κ²μ? μ λ΅νμΈ
apple = 2
banana = 3
cranberry = 1
detox = (banana ** 2 - 4 * apple * cranberry) // apple
print(detox)
1) 0 2) 1 3) 9 4) 3 |
1. μ λ΅ : 2
πλ¬Έμ νμΈ
ν΄μ€:
2. μ λ΅ : 3
πλ¬Έμ νμΈ
ν΄μ€:
3. μ λ΅ : 1
πλ¬Έμ νμΈ
ν΄μ€:
apple = 2
banana = 3
cranberry = 1
detox = (banana ** 2 - 4 * apple * cranberry) // apple
banana ** 2 = 3μ μ κ³± = 9
4 * apple * cranberry = 4 x 2 x 1 = 8
(9 - 8) // apple = 1 λλκΈ° 2 = 0
300x250