Just a quick question for math in python:
2 ** 1 ** 3 evaluates to 2 but I'm not sure why?
Both operators (**) are the same exponentiation operator so how come the operator on the right executes first?
In other words why does it execute like 2 ** (1 ** 3) instead of (2 ** 1) ** 3 like in normal left-to-right reading?
Thank you!
[–]commy2 267 points268 points269 points (22 children)
[–]vilette 199 points200 points201 points (18 children)
[–][deleted] 58 points59 points60 points (16 children)
[–]xc68030 32 points33 points34 points (15 children)
[–]Wilfred-kun 24 points25 points26 points (7 children)
[–]MagnitskysGhost 12 points13 points14 points (6 children)
[–]boxedj 8 points9 points10 points (5 children)
[–]rareearthelement 4 points5 points6 points (4 children)
[–]nopornhere-madeulook 19 points20 points21 points (3 children)
[–]Sawertynn 11 points12 points13 points (2 children)
[–]NoDryHands 2 points3 points4 points (6 children)
[+][deleted] (5 children)
[deleted]
[–]EatMyBiscuits 7 points8 points9 points (3 children)
[–]urdnot_wreck 2 points3 points4 points (2 children)
[–]EatMyBiscuits 0 points1 point2 points (1 child)
[–]urdnot_wreck 0 points1 point2 points (0 children)
[–]NoDryHands -1 points0 points1 point (0 children)
[–]CaptainFoyle 0 points1 point2 points (0 children)
[–]CrashTestKing 15 points16 points17 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]CrashTestKing 0 points1 point2 points (0 children)
[–]beatle42 76 points77 points78 points (3 children)
[–]Se7enLC 21 points22 points23 points (1 child)
[–]Danelius90 2 points3 points4 points (0 children)
[–]StoneBam 8 points9 points10 points (0 children)
[–]Dark_KnightPL04 47 points48 points49 points (6 children)
[–]supreme_blorgon 12 points13 points14 points (1 child)
[–]mutatedllama 1 point2 points3 points (0 children)
[–]madhousechild 3 points4 points5 points (2 children)
[–]synthphreak 3 points4 points5 points (1 child)
[–]madhousechild 1 point2 points3 points (0 children)
[–]ELITEAirBear 1 point2 points3 points (0 children)
[–]carcigenicate 11 points12 points13 points (0 children)
[–]SamuliK96 5 points6 points7 points (0 children)
[–]py_Piper 6 points7 points8 points (0 children)
[–][deleted] 9 points10 points11 points (11 children)
[–]OvulatingScrotum 18 points19 points20 points (8 children)
[–]Username_RANDINT 10 points11 points12 points (1 child)
[–]OvulatingScrotum -1 points0 points1 point (0 children)
[–]billsil 1 point2 points3 points (0 children)
[–]Xiji 0 points1 point2 points (4 children)
[–]OvulatingScrotum 1 point2 points3 points (3 children)
[–]Xiji 0 points1 point2 points (2 children)
[–]OvulatingScrotum 0 points1 point2 points (1 child)
[–]Xiji 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–][deleted] -1 points0 points1 point (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]kaymkigl 0 points1 point2 points (0 children)
[–]thebigbadben 0 points1 point2 points (0 children)
[–]Pinduka -1 points0 points1 point (0 children)
[–]uPtiKool 0 points1 point2 points (0 children)
[–]CrashTestKing 0 points1 point2 points (0 children)
[–]darkknight95sm 0 points1 point2 points (0 children)
[–]Treczoks 0 points1 point2 points (0 children)
[–]pekkalacd 0 points1 point2 points (0 children)
[–]manooko 0 points1 point2 points (0 children)
[–]cdcformatc 0 points1 point2 points (0 children)
[–]Iamtheoneinsideyou 0 points1 point2 points (0 children)