点击运行
#!/usr/bin/python3 # 定义函数. def temp_convert(var): try: return int(var) except ValueError, Argument: print ("The argument does not contain numbers\n", Argument) # 调用自定义的函数 temp_convert("xyz");
运行结果 :
正在执行...