3 ms·
> Can only use expressions, not statements. E.g. `print`s, loops, conditionals are out. print is a function (and thus can be used in expressions) python has c
by dragonwriter 6y ago
> Can only use expressions, not statements. E.g. `print`s, loops, conditionals are out.
print is a function (and thus can be used in expressions)
python has conditional expressions (<true-val> if <cond> else <false-val>)
loops are a limitation, though comprehensions, map(), functools.reduce(), and the itertools module can allow lots of looping functionality in an expression.