Welcome to the Treehouse Community
Looking to learn something new?
Tab Error on Dungeon Game
Whenever I try to run my game I get this error and I am unable to fix it? Any help is appreciated, thanks.
File "dungeon_game.py", line 12
if monster == door or monster == start or door == start:
TabError: inconsistent use of tabs and spaces in indentation
Yea that happens when posting here. So, it is possible that you may have, at separate times, used tab to indent and space to indent. This, in my experience, causes this error. Unfortunately, it is a pain. Highlight all of your code in your workspace, and click 'ctrl+]' until all of your code is left aligned, then you're going to re-indent ONLY using either space or tab. Tab is more convenient.
Could you delete your code post, and re-post with proper markdown? This is not legible. Post this way:
<your code here>
Ooop...ha sorry. I wrote the instructions but the markdown formatted my post.
If you go to the bottom of the box where you are typing, you'll see a markdown cheatsheet link. Click it.
it's either ctrl+] or ctr+[ it's been a while since i have used workspaces.
sorry for all the quick responses, but i would start with line 12 first and see if that is the only indentation problem