a=input("Please input a number:")def test(num): try: return float(a) except ValueError: return "请输入数字"print(test(a))