Python Forum

Full Version: understanding exponential and bitwise operators
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there,
I am new to python and would like to understand working of few expressions related to operators in python.
example :
a = 21
b = 10
c = 0

c **= a 
c //= a 

Output:
2097152
Output:
99864
a=60
b=13
c=0
c = a<< 2
c=a >> 2 

Output:
240
Output:
15
how these above expressions are evaluated ,bit confused in bitwise operators..
Thank you in advance
You may want to have a look here
Your example output for c **= a cannot be 2097152 if c is zero.
It would be correct if c is 2.