2022-11-26-TIL
π μ€λ 곡λΆν λ΄μ©β
- python μ»΄ν리ν¨μ
- νμ΄μ¬ λ¬Έλ² μ€ κ°μ₯ μ΄ν΄ μκ°λ λ¬Έλ². μ΄κ² μ λ§ κ°λ μ±μ΄ μ’μ λ¬Έλ²μΈκ° λΌλ μκ°μ΄ λ€μλ λ¬Έλ²
- 리μ€νΈ μ»΄ν리ν¨μ
- μλ‘μ΄ λ¦¬μ€νΈλ₯Ό λ§λλ λ°©λ²
- 짧μ μ½λλ‘ λ§λ€ μ μμ
- λ¬Έλ²μ μ΅μν΄μ§λ©΄ κ°λ μ±μ΄ μ’μμ§λ€?
- μνμ€μ λͺ¨λ μ¬μ© κ°λ₯
- μ€νΈλ§
- 리μ€νΈ
- range
- tuple
numbers = [1, 2, 3]
new_list = []
for n in numbers:
add_1 = n + 1
new_list.append(add_1)
# new_list = [new_item for item in list]
new_list = [n+1 for n in numbers]
new_list = [new_item for item in list]
- μ΄λ€ μμλ‘ μ½μ΄μΌ λ μ§ νΌλ μ€λ¬μΈμλ μμ§λ§?? μ΅μν΄μ§λ©΄ νΈνλ€???
μ‘°κ±΄μ΄ ν¬ν¨λ 리μ€νΈ μ»΄νλ μ΄μ β
new_list = [new_item for item in list if test]
names = ["Alex", "Beth", "Caroline", "dave", "Eleanor", "Freddie"]
upper_names = [n.upper() for n in names if len(n) >= 5]
- replit.com μ¬μ΄νΈλ νμ€ν μ°μ΅ μ©λλ‘ μ’μ κ² κ°λ€.