import math
def compute_area_of_circle(r):
return round(math.pi * r * r, 2)
print("area of 2 is:", compute_area_of_circle(2))
print("area of 3.14 is:", compute_area_of_circle(3.14))
print("area of 21 is:", compute_area_of_circle(21))
注:注意math模块的使用,注意round函数的使用