Help can't find the error

Help I get this error when I try to run my algo
SAPlayer 1 xermon-1.0: units = game_state.game_map(location1)
SAPlayer 1 xermon-1.0: ^
SAPlayer 1 xermon-1.0: TabError: inconsistent use of tabs and spaces in indentation

and this is what my code looks looks

Can someone help me

That error means python was unable to run your code because of syntax. Python uses whitespace to determine what block of code so it must be consistent. This means you probably have a combination of tab characters (\t) and spaces (’ '). While you can’t visually see a difference, there is one.

It looks like you’re using sublime, and if you highlight the entire block of code you’ll be able to see spaces with a dot and tabs with a line. If there is a combination of both, you’ll get this error.

In sublime, you can go to the bottom right click on where it says Tab Size and select Indent Using Spaces. Then click on Tab Size again and select Convert Indentation to Spaces.

Thanks :slight_smile: that did clear so much

love you thanks

1 Like