Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 16832

Order of operation for **

$
0
0

I want to know why does the following happen. The code below evaluates right side 1**3 first then 2**1

2**1**3 has the value of 2

However, for the below code left side 7//3 is evaluated first then 2*3. Finally 1+6-1=6.

1+7//3*3-1 has the value of 6

Viewing all articles
Browse latest Browse all 16832

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>