Our discipline obviously involves a lot of computation – in fact, I expect the first image that comes to mind when most people hear the words “data science” is one of numerical calculation. In this chapter, I’ll lay out the Python syntax for performing various mathematical operations on numbers, as well as manipulating strings. These things appear in every program, and you’ll find it all straightforward.
And then I’ll drop a bomb on you. I’ll unveil a Python behavior which you’ll probably find completely unexpected, which flummoxes nearly every student who first sees it, and yet which you must understand and master to succeed in Python or any programming language.