본문 바로가기
language/Python

[Python] 파이썬 숫자 처리 함수 ( 절대값, 최대값, 최소값, 반올림)

by By the Ronys 2020. 8. 11.
반응형
  • print(abs(-5)) # absolute 절대값 5 출력됨
  • print(pow(4,2)) # power 4^2
  • print(max(5,12)) # 최대값 12
  • print(min(5,12)) # 최소값 5
  • print(round(3.14)) # 반올림

  • from math import * # math 라이브러리 안에 있는 모든 것을 이용하겠다는 뜻
  • print(floor(4.99)) # 내림
  • print(ceil(3.14)) #올림
  • print(sqrt(16)) # 제곱근을 구하는 .

댓글