You can have a one-line "if" statement [1]:
if a == 42: print "Yes" ; do_stuff()
It's true that you cannot have a "else" statement on the same line, however.But in some cases, you could use a conditional expression instead [2]:
x = f() if a == 42 else g()
[1] http://docs.python.org/reference/compound_stmts.html[2] http://docs.python.org/reference/expressions.html#conditiona...