小白刚学python,raw_input语句出现错误。在线等解答!

来源:百度知道 编辑:UC知道 时间:2024/07/08 08:46:53
今天刚接触的PYTHON..刚才看书的时候按着书上的写了一个,结果运行的时候出现错误。。。。。。。。。。。我用的是SCRIP.NET,开发包是在蓝蚂蚁上下的。

#!/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--------------------
Save File: F:\bccccccccccccc!\if.py
Create org.interp.pyt

文件的格式问题,可能在 guess = int(raw_input('Enter an integer : '))
后缺少一个换行符之类的东西,导致解释器无法识别,换个文本编辑器,重新写代码。
代码本身是没问题的。