This screen is the Python 3 interaction shell screen, but when I try to break the line after typing else: at the bottom, I get an image-like error for some reason.What's wrong?
SyntaxError: inconsistent use of tabs and spaces in indication
The reason is that there is a mix of tabs and spaces to indent, as the message says, which is inconsistent.
For example, this article.
[Python error] TabError: inconsistent use of tabs and spaces indication
If it's IDLE's interaction shell (mode), this article seems to apply.
How to enter an indent - Python IDLE Basics
IDLE automatically adds "tabs" in interactive mode and "four half-width spaces" in the editor when you break a line with a compound statement.Therefore, to prevent mixing, use the same tab in interactive mode and four half-width spaces in the editor.
However, when typing, do not worry about anything and press Tab on both keyboards.
The IDLE editor is set to insert "four half-width spaces" when you press the Tab key, so you end up using only the Tab key on the keyboard.
Try entering indentation with the Tab key.
Also, the link in the above article does not seem to be directly related to the question, but I will introduce it to you because it may occur later.
How to Avoid Elif and Else Indentation Errors in Python IDLE Shell
If you are editing in the editor, the answer to this article With the IDLE editor you can use this: appears to have a resolution.
With the IDLE editor you can use this:
For more information in Japanese, see the Format menu (Shell window, Editor window) Untabbed Region.
Untabify Region
Replace all tabs with the appropriate number of spaces.
571 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
581 PHP ssh2_scp_send fails to send files as intended
617 Uncaught (inpromise) Error on Electron: An object could not be cloned
578 Understanding How to Configure Google API Key
609 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.