When using the compound operator in Python (operators that need to be typed, an indented block), and this block contains only simple operators , you can remove the newline character and separate the simple operators with a semicolon.
However, this does not support compound statements.
So:
if expression: print "something"
works but
while expression: if expression: print "something"
not because the operators whileand ifare integral.
if expression: assignment , :
while expression: target = true_expression if test_expression else false_expression
, while n<1000: rn += n if not (n % 3 and n % 5) else 0 .
, , , .