리μ€νΈ λ΄ μμμ μ΅μκ°, μ΅λκ°, μ΄ν© κ³μ°νκΈ°
min
, max
, sum
ν¨μλ€μ 리μ€νΈ, ννμ κ°μ λ°λ³΅ κ°λ₯ν κ°μ²΄μ λν΄ κ°κ° μ΅μκ°
, μ΅λκ°
, μ΄ν©
μ κ³μ°νλ λ° μ¬μ©λ©λλ€.
min() ν¨μ
min
ν¨μλ 리μ€νΈμ νν λ΄μμ κ°μ₯ μμ κ°μ λ°νν©λλ€.
min ν¨μ μμ
numbers = [4, 2, 8, 6] # 리μ€νΈ min_element = min(numbers) print(min_element) # 2
max() ν¨μ
max
ν¨μλ 리μ€νΈμ νν λ΄μμ κ°μ₯ ν° κ°μ λ°νν©λλ€.
max ν¨μ μμ
numbers = (4, 2, 8, 6) # νν max_element = max(numbers) print(max_element) # 8
sum() ν¨μ
sum
ν¨μλ 리μ€νΈμ νν λ΄μ λͺ¨λ μ«μμ ν©κ³λ₯Ό λ°νν©λλ€.
sum ν¨μ μμ
numbers = [4, 2, 8, 6] sum_of_numbers = sum(numbers) print(sum_of_numbers) # 20
Guidelines
AI Tutor
Publish
Design
Upload
Notes
Favorites
Help
Code Editor
Run
Generate
Execution Result