ki-hi-ro.com / blog
投稿日 更新日

【Python】少数第〇〇位までを四捨五入する

#少数第2位まで四捨五入

number = 3.14159

print(round(number, 2)) # Output: 3.14