Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in Python by (12.7k points)

I was simply messing with the python order line and the ** administrator, which to the extent I know plays out a power function. So 2 ** 3 ought to be (and is) 8 since 2 * 2 * 2 = 8. 

Would someone be able to clarify the conduct I found? I don't perceive any approach to bunch the tasks with enclosures to really get an aftereffect of 65536 like was achieved here.

>>> 2 ** 2 ** 2

16

>>> 2 ** 2 ** 2 ** 2

65536

>>> (2 ** 2 ** 2) ** 2

256

1 Answer

0 votes
by (26.4k points)

Check the below code:

2** (2**(2**2))

From this Documentation:

Operators in the same box group left to right (except for comparisons, including tests, which all have the same precedence and chain from left to right — see section Comparisons — and exponentiation, which groups from right to left).

Join the python online course fast, to learn python concepts in detail and get certified.

Related questions

0 votes
1 answer
asked Sep 30, 2019 in Python by Sammy (47.6k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories

...