in the following python code:
narg=len(sys.argv) print "@length arg= ", narg if narg == 1: print "@Usage: input_filename nelements nintervals" break
SyntaxError: 'break' outside loop
Because break cannot be used to break out of an if - it can only break out of loops. That's the way Python (and most other languages) are specified to behave.
What are you trying to do? Perhaps you should use
Because break can only be used inside a loop. It is used to break out of a loop (stop the loop).