On 01/31/2013 10:19 PM, Dave Wilder wrote:
On 01/31/2013 09:43 PM, Dave Wilder wrote:
Hello,
In a script I am writing, I would like to be able to accept the PAGE DOWN key
as an input as well as the arrow keys.
Is that possible w/ Python (I am using python 2.7.3 and Linux OS)? If so,
coul
On Thu, Jan 31, 2013 at 5:53 PM, Hugo Arts wrote:
>
a = ([], [])
a[0] += [1]
> TypeError: 'tuple' object does not support item assignment
a
> ([1], [])
Yep, storing the result fails for a read-only subscript or attribute
(e.g. a property without fset), but only after the in-place o
>> On 01/31/2013 09:43 PM, Dave Wilder wrote:
>> Hello,
>>
>> In a script I am writing, I would like to be able to accept the PAGE DOWN
>> key as an input as well as the arrow keys.
>>
>> Is that possible w/ Python (I am using python 2.7.3 and Linux OS)? If so,
>> could someone point me to do
On 01/31/2013 09:43 PM, Dave Wilder wrote:
Hello,
In a script I am writing, I would like to be able to accept the PAGE DOWN key
as an input as well as the arrow keys.
Is that possible w/ Python (I am using python 2.7.3 and Linux OS)? If so,
could someone point me to documentation on how to
Hello,
In a script I am writing, I would like to be able to accept the PAGE DOWN key
as an input as well as the arrow keys.
Is that possible w/ Python (I am using python 2.7.3 and Linux OS)? If so,
could someone point me to documentation on how to do that?
I have done things like this before
On 31/01/13 18:36, heathen wrote:
why is this:
>>> d = 2
>>> d *= 3 + 4
>>> d
14
not this:
>>> d
10
Others have answered but I'll add my two cents variation...
d *= 3+4 works like
d *= X -> d = d * X
so what is X? Is it the 3 or the 3+4.
Let's put some parentheses around things to m
On Thu, Jan 31, 2013 at 8:20 PM, Danny Yoo wrote:
> On Thu, Jan 31, 2013 at 11:36 AM, heathen
> wrote:
> > why is this:
> >
> d *= 3 + 4
>
>
> The gory details about how Python understands this expression can be found
> in:
>
>
> http://docs.python.org/3/reference/simple_stmts.html#augmente
heathen writes:
> why is this:
>
d = 2
d *= 3 + 4
d
> 14
hmm ...
because d * the result of 3 + 4
> not this:
>
d = 2
d = d * 3 + 4
d
> 10
and here it d multiply by 3 + 4
> ___
> Tutor maillist - Tutor@python.org
>
On Thu, Jan 31, 2013 at 11:36 AM, heathen wrote:
> why is this:
>
d *= 3 + 4
The gory details about how Python understands this expression can be found in:
http://docs.python.org/3/reference/simple_stmts.html#augmented-assignment-statements
Technically, "3 + 4" is the "expression lis
because python process the expression on the right side of the assignment
first.
ie d *= 3+4 basically is the equivalent of writing (2) * (3+4).
Hope that explains it.
Nick
On Thu, Jan 31, 2013 at 10:36 AM, heathen wrote:
> why is this:
>
> >>> d = 2
> >>> d *= 3 + 4
> >>> d
> 14
>
> not this:
why is this:
>>> d = 2
>>> d *= 3 + 4
>>> d
14
not this:
>>> d = 2
>>> d = d * 3 + 4
>>> d
10
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
11 matches
Mail list logo