Exponentiation gotcha

Question Q2.2.10

Explain why the following expression does not evaluate to 100.

>>> 10^2
8

Hint: Refer to the Python documentation for \emph{bitwise} operators.


Solution

To access solutions, please obtain an access code from Cambridge University Press at the Lecturer Resources page for my book (registration required) and then sign up to scipython.com providing this code.