这是我的代码:如何处理错误的输入(输入非数字值)?
def calc_area(radius):
return (radius **2) * (math.pi)
def calc_circ (radius):
return (math.pi * radius) * 2
radius = float(input('Please enter the cirlcle\'s radius: '))
print ('The area of the the circle is', calc_area(radius), 'and the circumference is', calc_circ(radius))
我能做些什么,以确保用户不会键入一个字母?