# 다양한 나눗셈의 결과
def main():
o_balance = 88 / 9
d_balance = 88 // 9
d_balance2 = int(88 / 9)
u_balance = round(88 / 9)
u_balance2 = round(88 / 9, 2)
print(type(o_balance), o_balance)
print(type(d_balance), d_balance)
print(type(d_balance2), d_balance2)
print(type(u_balance), u_balance)
print(type(u_balance2), u_balance2)
if __name__ == "__main__": main()
# 결과
<class 'float'> 9.777777777777779
<class 'int'> 9
<class 'int'> 9
<class 'int'> 10
<class 'float'> 9.78
댓글 영역