Guidelines

리슀트 λ‚΄ μš”μ†Œμ˜ μ΅œμ†Œκ°’, μ΅œλŒ€κ°’, 총합 κ³„μ‚°ν•˜κΈ°

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