Dennis Lee Bieber :
> I suppose, the two in combination imply that the calls to "f()"
> occur first in left to right, but then the "**" are applied to the
> returned values right to left -- rather than having the calls
> performed in the exponentiation order.
Yes, and parentheses, operator
On Thu, 17 Aug 2017 09:12 am, Dennis Lee Bieber wrote:
> I suppose, the two in combination imply that the calls to "f()" occur
> first in left to right, but then the "**" are applied to the returned
> values right to left -- rather than having the calls performed in the
> exponentiation order.
St
Steve D'Aprano writes:
> On Wed, 16 Aug 2017 11:38 pm, Ben Bacarisse wrote:
>
>> r...@zedat.fu-berlin.de (Stefan Ram) writes:
>>
>>> I wrote my first Python quiz question!
>>>
>>> It goes like this:
>>>
>>> Can you predict (without trying it out) what the Python
>>> console will output a
Ian Kelly :
> On Wed, Aug 16, 2017 at 6:51 AM, Dennis Lee Bieber
> wrote:
>>>def f(i): print(i); return i;
>>>
>>>f(4)**f(1)**f(2)
>>>
>>
>> As a first guess
>>
>> 2
>> 1
>> 4
>>
>> 4
>>
>> since in many languages, exponentiation associates right to left
>
> I thought the same thing but f
On Wed, Aug 16, 2017 at 6:51 AM, Dennis Lee Bieber
wrote:
> On 16 Aug 2017 11:06:26 GMT, r...@zedat.fu-berlin.de (Stefan Ram) declaimed
> the following:
>
>> I wrote my first Python quiz question!
>>
>> It goes like this:
>>
>> Can you predict (without trying it out) what the Python
>> console
On Wednesday, August 16, 2017 at 2:52:09 PM UTC+1, Steve D'Aprano wrote:
> On Wed, 16 Aug 2017 10:29 pm, breamoreboy wrote:
>
> > How do you expect to get four lines of output from the three function calls?
>
> In the REPL (the interactive interpreter) the result of evaluating the line is
> print
On Wednesday, August 16, 2017 at 12:45:13 PM UTC+1, Steve D'Aprano wrote:
> On Wed, 16 Aug 2017 09:06 pm, Stefan Ram wrote:
>
> > I wrote my first Python quiz question!
> >
> > It goes like this:
> >
> > Can you predict (without trying it out) what the Python
> > console will output afte
On Wed, 16 Aug 2017 11:38 pm, Ben Bacarisse wrote:
> r...@zedat.fu-berlin.de (Stefan Ram) writes:
>
>> I wrote my first Python quiz question!
>>
>> It goes like this:
>>
>> Can you predict (without trying it out) what the Python
>> console will output after the following three lines have
On Wed, 16 Aug 2017 10:29 pm, breamore...@gmail.com wrote:
> How do you expect to get four lines of output from the three function calls?
In the REPL (the interactive interpreter) the result of evaluating the line is
printed.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheere
r...@zedat.fu-berlin.de (Stefan Ram) writes:
> I wrote my first Python quiz question!
>
> It goes like this:
>
> Can you predict (without trying it out) what the Python
> console will output after the following three lines have
> been entered?
>
> def f(i): print(i); return i;
>
> f(4)**
On Wed, 16 Aug 2017 09:06 pm, Stefan Ram wrote:
> I wrote my first Python quiz question!
>
> It goes like this:
>
> Can you predict (without trying it out) what the Python
> console will output after the following three lines have
> been entered?
>
> def f(i): print(i); return i;
>
>
On Wed, Aug 16, 2017 at 7:06 AM, Stefan Ram wrote:
> I wrote my first Python quiz question!
>
> It goes like this:
>
> Can you predict (without trying it out) what the Python
> console will output after the following three lines have
> been entered?
>
> def f(i): print(i); return i;
>
>
12 matches
Mail list logo