.2f,前面少了一个点
from math import pi # pi 就是 π r = 10.5 s = pi * r * r print( "{:.2f}".format(s) ) #保留 2位小说可以用 .2f ,也可以用 round 函数