Skip to main content
 首页 » 编程设计

python之为什么我从看起来正确对齐的代码中得到 `TabError`

2025年05月04日13findumars

<分区>

以下 python 代码抛出此错误消息,我不知道为什么,我的选项卡似乎在一行中:

File "test.py", line 12 
    pass 
       ^ 
TabError: inconsistent use of tabs and spaces in indentation 
class eightPuzzle(StateSpace): 
    StateSpace.n = 0 
     
    def __init__(self, action, gval, state, parent = None): 
        StateSpace.__init__(self, action, gval, parent) 
        self.state = state 
 
    def successors(self) : 
        pass