Programming/Python
[Python] 소수점 반올림, 자리수
쌍쌍바나나
2016. 4. 19. 15:31
반응형
파이썬에서 round를 이용해 소수점 반올림에 대한 코드
print round(2.3333) # 2.0 print round(2.3333, 2) # 2.33 print round(2.5) # 3.0 print round(2.5555, 2) # 2.56 print '%.2f' % 2.555 #2.56
반응형