This is one of the frustrating things about python, but the kind of spacing in front of each line matters. Take a look at this:
for i in x:
# does some stuff
The error you’re most likely hitting is this one, where you think you’ve placed
def wrongspaces at column 0 lined up with
def test, but in reality you accidentally indented it so it’s inside
def test(). When that happens it won’t run because it’s considered a part of test().
What’s worse is probably all of the code inside
def wrongspaces(): is also indented, so you have to “de-dent” to bring it all back to the left by the same amount.
To do that depends on the editor you’re using (tell me and I’ll get specific) but usually it’s something like select all the text and hit shift-tab to move it back one block.
“Whitespace” just means a blank space, tab, or similar character. It’s called whitespace because for thousands of years paper was white and if you put space then that space is white. Really it should be called “blank space” given that you can have a wild array of backgrounds. Like, my text editor is dark brown.