π 리μ€νΈ count() κΈ°μ΅νκΈ°
temp = [1, 1, 2, 3, 4, 5] temp.count(1) # 2 temp.count(2) # 1
π replace() ν¨μ
- μ¬λ¬ λ¬Έμλ₯Ό νλ²μ λ°κΎΈκ³ μΆμλ ν΄λΉ λ¬Έμλ₯Ό iterableν μν¨ ν λ°λ³΅λ¬Έ λλ €μ λ°λ³΅νκΈ°
- regexλ₯Ό μ¬μ©ν΄λ λλ μ½λ©ν μ€νΈ μ regex μ¬μ© λ¬Έμ κ° λμ¬λ¦¬ λ§λ¬΄νλ λ°°μ
temp = 'aaeeff' temp.replace('a', 'e') # 'eeeeff' temp.replace('a', 'e', 1) # 'eaeeff' temp_re = ['a', 'e', 'f'] for re in temp_re: temp = temp.replace(re, 'b') # 'bbbbbb'
π extends & include
- {% include 'test.html' %} μ μ¬μ©νκ² λλ©΄ test.html νμΌμ κ°μ Έμμ μνλ μμΉμ μ¬μ© κ°λ₯νλ€.
- {% extends 'test.html' %} μ μ¬μ©νκ² λλ©΄ test.html νμΌμ λ€ κ°μ Έμ€κ³ , test.html μ λΈλ‘ λ΄μ©λ§ λ°κΏ μ μκ² λ§λ€ μ μλ€.
νμ¬ μ¬μ©μ€μΈ νμΌμ λκ°μ λΈλ‘μ λ§λ€μ΄ μ€ ν κ·Έ λΈλ‘ μ λ΄μ©λ§ μμ μ νκ²λλ©΄ λ³κ²½ κ°λ₯νλ€.
{% block 'λΈλ‘λͺ ' %}
{% endblock %}
π νλ‘μ νΈλ₯Ό νλλΌ μ μ μ΄ μμ΄ κ°λ¨ν λ¬Έμ λ€λ§ νκ³ μλ€.
κ·Έλλ μ¬λ¬ λ¬Έμ λ₯Ό νκ³ μμ§λ§ μ 리λ λ€μμ£Όμ λͺ°μμ νλκ±Έλ‘...γ