-
[python] 숫자처리함수python 2025. 5. 22. 15:41
print(abs(-5)) # 절대값, 5 print(pow(4, 2)) # 4^2 = 4*4 = 16 print(max(5, 12)) # 최대값, 12 print(min(5, 12)) # 최소값, 5 print(round(3.14)) # 반올림, 3 print(round(4.99)) # 반올림, 5 from math import * print(floor(4.99)) # 내림, 4 print(ceil(3.14)) # 올림, 4 print(sqrt(16)) # 제곱근, 4
'python' 카테고리의 다른 글
[python] 문자열 처리함 (0) 2025.05.22 [python] 슬라이싱 (0) 2025.05.22 [python] 랜덤함수 (0) 2025.05.22 [python] 변수 (0) 2025.05.22 [python] 사전 환경 구성 (0) 2025.05.22