On Jan 13, 5:36 pm, Steve Holden wrote:
> Miles wrote:
> > On Tue, Jan 13, 2009 at 12:02 AM, imageguy wrote:
> >> Using py2.5.4 and entering the following lines in IDLE, I don't really
> >> understand why I get the result shown in line 8.
>
> >> Note the difference between lines 7 and 10 is that
On Jan 13, 1:01 am, Miles wrote:
> On Tue, Jan 13, 2009 at 12:02 AM, imageguy wrote:
> > Using py2.5.4 and entering the following lines in IDLE, I don't really
> > understand why I get the result shown in line 8.
>
> > Note the difference between lines 7 and 10 is that 'else' clause
> > result en
imageguy writes:
> Using py2.5.4 and entering the following lines in IDLE, I don't really
> understand why I get the result shown in line 8.
>
> Note the difference between lines 7 and 10 is that 'else' clause
> result enclosed in brackets, however, in line 2, both the 'c,d'
> variables are assig
imageguy wrote:
1) >>> n = None
2) >>> c,d = n if n is not None else 0,0
...
This is more easily expressed as:
c, d = n or (0, 0)
--
http://mail.python.org/mailman/listinfo/python-list
imageguy wrote:
>Using py2.5.4 and entering the following lines in IDLE, I don't really
>understand why I get the result shown in line 8.
>
>Note the difference between lines 7 and 10 is that 'else' clause
>result enclosed in brackets, however, in line 2, both the 'c,d'
>variables are assign corr
Miles wrote:
> On Tue, Jan 13, 2009 at 12:02 AM, imageguy wrote:
>> Using py2.5.4 and entering the following lines in IDLE, I don't really
>> understand why I get the result shown in line 8.
>>
>> Note the difference between lines 7 and 10 is that 'else' clause
>> result enclosed in brackets, howe
On Tue, Jan 13, 2009 at 12:02 AM, imageguy wrote:
> Using py2.5.4 and entering the following lines in IDLE, I don't really
> understand why I get the result shown in line 8.
>
> Note the difference between lines 7 and 10 is that 'else' clause
> result enclosed in brackets, however, in line 2, both
> understand why I get the result shown in line 8.
>7) >>> c,d = n if n is not None else 0,0
>8) >>> print c,d
>9) (22, 11) 0
OOPS sorry that should be line 9.
g.
--
http://mail.python.org/mailman/listinfo/python-list
Using py2.5.4 and entering the following lines in IDLE, I don't really
understand why I get the result shown in line 8.
Note the difference between lines 7 and 10 is that 'else' clause
result enclosed in brackets, however, in line 2, both the 'c,d'
variables are assign correctly without the bracke