Sep-19-2019, 10:54 PM
doing conditionals in one line or at least one very long line is needed when doing a stack of elifs. of course you can generally encapsulate the test into a function and call it in one line. i just wish there was an easy way to code the actual test in one line, pass that to the function, and have the function do it ... inside a try/except.
that, or add something like the
that, or add something like the
foo = expression1 if condition else expression2
to do try/except and return on expression or the other like foo = try expression1 except whatever expression2
.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.