0
IndentationError
hey, I'm trying to learn python while using my linux terminal (I'm kinda new on this OS) and when i try to write the parto of the code after "print("3")", it just shows me a message that says: 'File "<stdin>", line 2 print("3") \n if num<5: ^ IndentationError: expected an indented block' Can anyone please help me to understand how can I solve this please??
2 Antworten
+ 7
You probably forgot to indent the instruction, and your previous line require a bloc of instruction:
a = 42
if a > 0:
print("Positive")
Thar produce an indent error at line 3, because the if statement require at least one line indented to be into its body, as this:
a = 42
if a > 0:
print("Positive")
^^
+ 3
can you post a link for your code in the code playground?
To see what is the problem we need to see the code before that print.