PYTHON的超级小白问题。。raw_input语句提示错误,在线等

#!/usr/bin/python#Filename:if.pynumber=23guess=int(raw_input('Enteraninteger:'))ifgue... #!/usr/bin/python
# Filename: if.py

number = 23
guess = int(raw_input('Enter an integer : '))

if guess == number:
print 'Congratulations, you guessed it.' # New block starts here
print "(but you do not win any prizes!)" # New block ends here
elif guess < number:
print 'No, it is a little higher than that' # Another block
# You can do whatever you want in a block ...
else:
print 'No, it is a little lower than that'
# you must have guess > number to reach here

print 'Done'
# This last statement is always executed, after the if statement is executed

结果提示错误:
--------------------OwmEdit : Debug org.interp.python Script--------------------
Create org.interp.python Interpret: Interp_Script
Start eval script F:\bccccccccccccc!\if.py at run mode...
Enter an integer :
Script eval error at line[6]
Result is: Traceback (most recent call last):
File "F:/bccccccccccccc!/if.py", line 6, in <module>
guess = int (raw_input)
TypeError: int() argument must be a string or a number, not 'builtin_function_or_method'
Traceback (most recent call last):
File "F:/bccccccccccccc!/if.py", line 5, in <module>
guess = int(raw_input('Enter an integer : '))
EOFError: EOF when reading a line
Traceback (most recent call last):

望解答,在线等
展开
 我来答
匿名用户
2009-09-18
展开全部
int()里面不能是内部方法,可以这样
guess = raw_input('Enter an integer : ')
然后再用int(guess)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式