0

IndentationError : expected an indented block in pyton

How to solve it ???? IndentationError : expected an indented block https://sololearn.com/compiler-playground/ckZJbCdhI343/?ref=app

24th Mar 2024, 4:39 PM
RayBan
RayBan - avatar
5 Antworten
+ 4
The error is due to the fact that you have not identified the code correctly, the indentation refers to, for example, if you receive a song and you must give 3 spaces so that you can enter what you want to be shown if the condition is met
24th Mar 2024, 9:55 PM
STE4LPH
STE4LPH - avatar
+ 1
It means your indentation is wrong. You need to check the indentation of your code blocks.
24th Mar 2024, 4:49 PM
Lisa
Lisa - avatar
+ 1
This is not correcting in mobile .
24th Mar 2024, 4:56 PM
RayBan
RayBan - avatar
+ 1
in python white space matters! every "code block" should have the same indentation.... PS: after fixing this issue, you will face another problem in this code
24th Mar 2024, 5:57 PM
Mihaly Nyilas
Mihaly Nyilas - avatar
+ 1
RayBan , Look for the colons. Every line ending with a colon (":") needs an indented block of at least one statement below it (not counting empty lines). You can use the pass keyword to supply a do-nothing statement that satisfies the required code block until you fill it in later. Also, for readability, it's good practice to separate class definitions with two empty lines and separate method definitions with one empty line to give visual cues of the hierarchy. class C: def f(self): pass def g(self): pass class D: def h(self): pass def i(self): pass
25th Mar 2024, 5:05 AM
Rain
Rain - avatar