Sunday, June 26, 2016

Python Carrot Puzzle

I recently discovered that '^' does not mean 'to the power of' in Python.  I discovered this in quite a painful way while coding in a library. Librarians don't like it when you start yelling at your computer.  They get aggressive.  They get mean.  Some of them know Jujitsu.

It turns out that 3^2 is not 9.            3**2 is 9.

3^2 is 1.  That seems easy.  3-2=1.  

Well, 3^8 is 11.  Oh...so 3+8=11. 


*%*$!!     3^6 is 5!!!!!!!


Look at the pattern below.  What do you see?


No comments:

Post a Comment