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