python运行错误---TabError: Inconsistent use of tabs and spaces in indentation

python运行错误---TabError: Inconsistent use of tabs and spaces in indentation

首先这个错误的意思是:在缩进的时候,使用了错误的空格和tab
我使用的python3.5,造成这个错误的原因是我在函数里面敲if....elif 判断语句的时候,elif之前先用了空格然后再用tab完成了对齐,也就是说,这种错误产生的原因正是由于空格或者tab缩进造成的。
然后我做了试验,将空格删除,直接使用tab完成缩进,发现程序正常运行;
再试一下空格缩进,然后发现还是报错了,同样TabError: Inconsistent use of tabs and spaces in indentation。
 
也就是说,python3.5是要用tab完成缩进的,而且不能使用空格,否则会报错