On Jan 10, 2:28 pm, bearophileh...@lycos.com wrote:
> Scott David Daniels:
>
> > if checking:
> > my_var = 'string'
> > else:
> > my_var = 'other string'
>
> > remember, vertical space only kills trees if printed.
>
> I value clarity a lot. But this is more DRY, some
Scott David Daniels:
> if checking:
> my_var = 'string'
> else:
> my_var = 'other string'
>
> remember, vertical space only kills trees if printed.
I value clarity a lot. But this is more DRY, sometimes it's almost
equally clear, and you reduce vertical space, packi
Duncan Booth wrote:
Gandalf wrote:
other languages ... [have an] if-else operator like...
myVar = checking == 1? 'string': 'other string'
See http://docs.python.org/reference/expressions.html#boolean-operations
...
The expression x if C else y first evaluates C (not x); if C is true, x i
On Jan 10, 2009, at 9:26 AM, Duncan Booth wrote:
Gandalf wrote:
other languages like PHP or javascript as this if-else operator like
this
myVar = checking == 1? 'string': 'other string'
is this stuff exist in python?
See http://docs.python.org/reference/expressions.html#boolean-operati
Gandalf wrote:
> other languages like PHP or javascript as this if-else operator like
> this
>
> myVar = checking == 1? 'string': 'other string'
>
> is this stuff exist in python?
>
See http://docs.python.org/reference/expressions.html#boolean-operations
conditional_expression ::= or_test