프로그래밍 문법/python

파이썬반올림 함수 round

씩씩한 IT블로그 2020. 6. 19. 21:28
반응형

round(실수,n) : 실수를 반올림하여 소수점 n째자리 까지 나타낸 수

<input>

print(round(16.35,2))
print(round(16.35,1))
print(round(16.35,0))
print(round(16.35))
print(round(16.35,-1))

 

<output>

더보기

16.35

16.4

16.0

16

20.0

반응형