NEITHER of the 3 snippets you show above can possibly work on ANY python version/iterpreter! They have the same problem. The indentation of line 3 is INCONSISTENT with the rest of the indentation of the code. In addition the indentation of the last line in the third snippet is off too. The error you get is pretty clear too.
for i in [12, 16, 17, 24, 29]: if i % 2 == 1: # 4 spaces indentation = 1 level deep break # 7 spaces indentation, when it has to be 8 spaces to represent 2 levels deep indentation print(i) # 4 spaces indentation = 1 level deep print("done")this will work
for i in [12, 16, 17, 24, 29]: if i % 2 == 1: # 4 spaces indentation = 1 level deep break # 8 spaces indentation = 2 levels deep indentation print(i) # 4 spaces indentation = 1 level deep print("done")If you are not reading and following what you have been told or what the error says, no one can help you though.
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
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs