程序是从上到下运行的,为什么下面的代码不执行块中的第一行就直接抛出错误?
if 5 > 2:
print("Two is less than Five!")
print("Five is greater than two!")
错误: 文件“/Users/____/Desktop/Python practise/practise.py”,第 3 行 print("五比二大!") 缩进错误:意外缩进
您不需要在第三行中进行额外的缩进。这是带有正确列表的代码:
if 5 > 2:
print("Two is less than Five!")
print("Five is greater than two!")