2011-03-26 90 views
0

我有运行在IDLE提示这个简单的语句麻烦。输入复合语句interactivly

if True: 
    print("True") # need to press ENTER twice? 
else: 
    print("False") # need to press ENTER twice? 

任何帮助表示赞赏。当你按回车键

+0

使用Python 2或3? 2看起来没问题;需要使用'的print()'在3 – 2011-03-26 21:34:40

+2

哦,你的缩进是不一致的。 – 2011-03-26 21:34:59

+0

这是Python3。固定和重新标记。 – pic11 2011-03-26 21:39:43

回答

1

空闲时自动缩进。按删除可删除自动缩进。

if True: 
    print("True") # press return, then backspace 
else: 
    print("False") 
+0

工作就像一个魅力。非常感谢。必须等待5分钟才能接受,因为我的配额已超过,因此无法投票:) – pic11 2011-03-26 21:42:25