Python Forum
[SOLVED] Expected An Indented Block
Thread Rating:
  • 3 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Expected An Indented Block
#1
Here is my code:
    if console == 'y':
                # Placeholder
                pass
            elif console == 'Y':
                # Placeholder
                pass
            elif console == 'n':
                # Placeholder
                pass
            elif console == 'N':
                # Placeholder
                pass
            elif console == 'Exit':
                sys.exit(0)
            else:
                print('Unknown Command')
                sys.exit(0) # Placeholder
On the line
else if console == 'Y':
i get the error
Error:
SyntaxError: Expected An Indented Block
I'm using IDLE, so i'm getting told its a problem with the "else" in
else if console == 'Y':
I don't understand what I'm supposed to do. If i indent the line, i get the error
Error:
SyntaxError: Invalid Syntax
What am i supposed to do to fix this? If i manage to fix one, the rest will probably return the same error.
Self-taught HTML, CSS, Python, and Java programmer
Reply


Messages In This Thread
[SOLVED] Expected An Indented Block - by Panda - Jun-06-2018, 06:12 PM
RE: Expected An Indented Block - by Larz60+ - Jun-06-2018, 06:36 PM
RE: Expected An Indented Block - by Panda - Jun-06-2018, 09:16 PM
RE: Expected An Indented Block - by buran - Jun-06-2018, 06:37 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to write in text file - indented block Joni_Engr 4 6,559 Jul-18-2022, 09:09 AM
Last Post: Hathemand
  how far is this line indented? Skaperen 3 1,367 May-30-2022, 05:49 PM
Last Post: Skaperen
Thumbs Up [SOLVED] Simplify condition test in if block? Winfried 2 1,744 Aug-25-2021, 09:42 PM
Last Post: Winfried
  [SOLVED] [geopy] "ValueError: too many values to unpack (expected 2)" Winfried 2 2,910 Mar-30-2021, 07:01 PM
Last Post: Winfried
  error "IndentationError: expected an indented block" axa 4 2,971 Sep-08-2020, 02:09 PM
Last Post: ibreeden
  IndentationError: expected an indented block ryder5227 2 2,643 Sep-27-2019, 06:59 PM
Last Post: jefsummers
  SOLVED: best way to block (wait on) shell calls to multiple windows programs at once? ezdev 0 2,629 Dec-10-2017, 06:42 AM
Last Post: ezdev
  Expected an indented block Nicoles07 2 3,456 Sep-15-2017, 05:19 PM
Last Post: deaspo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020