⊗pyPmBsNPP 20 of 208 menu

Exponentiation Precedence in Python

The exponentiation operation takes precedence over multiplication and division. The following example will first perform the exponentiation and then the multiplication:

print(2 * 2 ** 3) # 16

The following code is given:

res = 2 * 3 ** 2 print(res)

Tell me what will be output to the console.

The following code is given:

res = (7 + 4) * (3 - 1) ** 3 print(res)

Tell me what will be output to the console.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline