Python Forum
error "IndentationError: expected an indented block"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
error "IndentationError: expected an indented block"
#2
You have a function and the body of the function should be indented. you have several if blocks that require indented block after that. in all occasions next line is not indented. Also you have else part that not match any of the preceding ifs. Also first if is indented, when it should not be. Overall your indentation is totally wrong
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
RE: error "IndentationError: expected an indented block" - by buran - Sep-08-2020, 10:16 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to write in text file - indented block Joni_Engr 4 8,751 Jul-18-2022, 09:09 AM
Last Post: Hathemand
  how far is this line indented? Skaperen 3 2,215 May-30-2022, 05:49 PM
Last Post: Skaperen
  IndentationError: unexpected indent dee 3 4,157 May-02-2022, 02:15 AM
Last Post: dee
  TypeError: sequence item 0: expected str instance, float found Error Query eddywinch82 1 7,548 Sep-04-2021, 09:16 PM
Last Post: eddywinch82
  pandas.errors.ParserError: Error tokenizing data. C error: Expected 9 fields in line Anldra12 9 23,563 Jun-15-2021, 08:16 AM
Last Post: Anldra12
  zlib decompress error: invalid code lengths set / invalid block type DreamingInsanity 0 9,518 Mar-29-2020, 12:44 PM
Last Post: DreamingInsanity
  IndentationError: unexpected indent jk91 1 3,231 Feb-27-2020, 08:56 PM
Last Post: buran
  how can i handle "expected a character " type error , when I input no character vivekagrey 2 3,751 Jan-05-2020, 11:50 AM
Last Post: vivekagrey
  capture next block of text after finding error in file kdefilip2 6 5,027 Nov-27-2019, 07:36 PM
Last Post: buran
  IndentationError jagannath 1 3,161 Nov-04-2019, 07:41 AM
Last Post: buran

Forum Jump:

User Panel Messages

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