初学phython的人,肯定都被它的空格绕进去了。在phython中不能随便插入空格。这个真的太不方便了。就拿我的第一个例子来说吧。
1 打开phython3.2 的phython shell
2 [file]-[new window],新建窗体
3 [file]-[save as]保存文件名为 if.py
4在文件中输入如下代码
number=23
guess=int(input('enter an interger'))
if guess==number:
print("congratulations,you guessed it")
print("but you don't win any prizes")
elif guess<number:
print ('No, it is a little lower than that') # Another block
else:
print('No, it is a little higher than that' )
print('down')
如不按照格式输入,则F5运行会报错~