import math
def solution(flo):
return math.floor(int(flo))
<aside> 💡
처음엔 abs() 절댓값을 구해서 정수부분만 남기려고 했는데, 절댓값은 부호만 없애는 개념이어서 의미가 없었다. 그럼 올림과 내림을 이용해 보자. 그전에 abs를 알고 가자
</aside>
abs()
란import math
def solution(flo):
return math.floor(int(flo))
<aside> 💡
검색해서 floor 즉 내림을 사용하는 방법을 배우고 작성했다!
</aside>
int()
= math.trunc()
, math.floor()