Solved
IndentationError: expected an indented block
Copied the if example into my editor, changed a bit and now get this error. The code looks fine to me.
Copied the if example into my editor, changed a bit and now get this error. The code looks fine to me.
Comments 5
Join the discussion CommentAlready have an account? Log in
Can you paste it? Usually it's an
ifline ending with:and nothing indented below it.Yep, the print needs to be indented (4 spaces is standard) to belong to the if:
In Python the indentation is the block, there are no curly braces.
Ahh, I deleted the spaces by accident. Thanks!
Tip: don't mix tabs and spaces. The editor here inserts 4 spaces when you press Tab, which is the safe default.