def power(x=1, y=1): if not (isinstance(x, (int, float)) and isinstance(y, (int, float))): # 判断参数x,y是否是int或float print("输入错误") return # 当x或y不是int或float时,在此终止function Zhi = x ** y return Zhi print(power(4, 5.1))