Jump to content
Ch 2 - Pg 56
1 reply to this topic
Posted 05 July 2013 - 11:15 AM
Hi, I'm stuck in this page, I try to run the code from page 56 but I keep getting this:
~/Documents$ python3 nester.py
File "nester.py", line 12
print("\t", end=' ')
TabError: inconsistent use of tabs and spaces in indentation
Posted 08 July 2013 - 11:50 PM
When it comes to indenting code in Python, you can use tabs or spaces, but not both. You must consistently use one or the other. If you mix tabs and spaces in your code, Python gets confused. To fix this problem in IDLE (with your code in the Edit Window), choose "Select All" from the "Edit" menu, then choose "Untabify Region" from the "Format" menu. That should get rid of the TabError.
Hope this helps.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users