输入一个数据x当x为数字时输出x的平方否则提示输入错误。用Python语言try语句写出上述的代码
try: x = float(input("请输入一个数字:")) print(x ** 2) except ValueError: print("输入错误")
原文地址: https://www.cveoy.top/t/topic/eYHb 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
try: x = float(input("请输入一个数字:")) print(x ** 2) except ValueError: print("输入错误")
原文地址: https://www.cveoy.top/t/topic/eYHb 著作权归作者所有。请勿转载和采集!