파이썬 math.sqrt() 메서드
예시
다른 숫자의 제곱근 찾기:
# Import math Library
import math
# Return the square root of
different numbers
print (math.sqrt(9))
print (math.sqrt(25))
print
(math.sqrt(16))
정의 및 사용
이 math.sqrt()
메서드는 숫자의 제곱근을 반환합니다.
참고: 숫자는 0보다 크거나 같아야 합니다.
통사론
math.sqrt(x)
매개변수 값
Parameter | Description |
---|---|
x | Required. A number to find the square root of. If the number is less than 0, it returns a ValueError. If the value is not a number, it returns a TypeError |
기술적 세부 사항
반환 값: | float 숫자의 제곱근을 나타내는 값 |
---|---|
파이썬 버전: | 1.4 |