Objects and References

4. Objects and References#

By now you should be comfortable assigning variables and have used the = operator many times. Unfortunately, we need to give you some bad news: that innocent = sign is not so simple as you may be used to in a mathematics course! In Python, the = operator has some very specific behavior. While this chapter may seem unecessarily complex at the moment, a basic understanding of objects and references can help you a lot later on. We’ve seen many of our students and colleagues banging their heads against the wall trying to fix a “bug” in their code, only to realize it was a problem with the way they assigned and used variables.