在编写python的代码过程中,一直出现这个错误:

D:\anaconda3\python.exe C:\Users\admin\Pyecharts\pythonProject1\test\whileSum.py 
  File "C:\Users\admin\Pyecharts\pythonProject1\test\whileSum.py", line 9
    print(whileSum())
                     ^
IndentationError: unindent does not match any outer indentation level

进程已结束,退出代码为 1

源代码如下:

def whileSum():
    i=0
    sum=0
    while i<=100:
        sum=sum+i
        i=i+1;
        return sum
 print(whileSum())

 看了半天也没有发现是那里的错误

原来是:

IndentationError: unindent does not match any outer indentation level_python

原因:新的Python语法中是不支持的代码对齐中,混用TAB和空格的