Skip to main content
 首页 » 编程设计

python else 和 elif 错误

2025年05月04日12Free-Thinker

<分区>

>>> if 5==5: 
print '5' 
else: print 'cat' 
 
File "<pyshell#2>", line 3 
else: print 'cat' 
                ^ 
 IndentationError: unindent does not match any outer indentation level 

不管缩进多少,还是不行。即使我尝试将 print cat 语句放在下一行,它也会给我语法错误。这是为什么?