티스토리 뷰

파이썬에서 특정 소숫점자리에서 반올림하려면 round 함수를 사용하면 됩니다.
# 소수점 3째 자리에서 반올림
print ( round(3.123456, 3) )
# 출력 결과: 3.1235
댓글