YYYEJI

[Python] Math 모듈 본문

Python

[Python] Math 모듈

YEJI ⍢ 2022. 11. 3. 16:47
728x90

모듈(module)이란?

모듈이란 함수나 변수 또는 클래스를 모아 놓은 파일입니다.

 

 

Math 모듈을 이용하기 위해서는 math 모듈을 import 해줘야됩니다.

import math

 

 

import math

print(math.ceil(3.14))       # ceil function
print(math.floor(3.78))      # floor function
print(math.factorial(5))     # factorial
print(math.fabs(-3.14))      # -
print(math.pow(3, 2))        # power of
print(math.sqrt(25))         # square 
print(math.sin(90))          # sine
print(math.cos(90))          # cosine
print(math.tan(90))          # tangent

 

 

◡̈

'Python' 카테고리의 다른 글

[Python] Random 모듈  (0) 2022.11.03
[Python] datetime 모듈  (0) 2022.11.03
[Python] Pillow(PIL) 모듈  (0) 2022.11.03
[Python] 파이썬 터틀(Turtle)이란?  (0) 2022.10.24
[Python] 튜플의 packing, unpacking 이해하기  (0) 2022.10.13