【发布时间】:2019-01-05 10:15:52
【问题描述】:
def sqrt():
x = input('enter a number:' )
x= int()
if x == int:
a = x*x
print (a)
else:
print ('this is not a number')
这是我的代码,我想输入一个数字并将其相乘,但没有成功。当我运行我的程序时;
sqrt()
输入一个数字:10 这不是一个数字
但是我写的代码应该给'if'语句'True'。有什么帮助吗?
【问题讨论】:
-
您有几个基本错误,我强烈建议您阅读结构化教程。与此同时,规范副本是stackoverflow.com/questions/23294658/…
标签: python xcode python-3.x debugging