Ian Kelly <ian.g.ke...@gmail.com>: > On Wed, Aug 16, 2017 at 6:51 AM, Dennis Lee Bieber > <wlfr...@ix.netcom.com> 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 figured there was no reason to eval f(2) > before f(1), so I came up with > > 1 > 2 > 4 > 4 > > which is also wrong.
Python evaluates expressions from left to right. <URL: https://docs.python.org/3/reference/expressions.html#evaluati on-order> Marko -- https://mail.python.org/mailman/listinfo/python-list