DEV Community

Discussion on: Dead Simple Python: Data Typing and Immutability

Collapse
 
codemouse92 profile image
Jason C. McDonald

You're correct that == and is are not the same thing. However, that code does indeed work as I posted (I tested it). Strings are immutable, meaning that richestDuck is "Scrooge McDuck" evaluates to True on the basis that richestDuck is bound directly to the immutable string literal "Scrooge McDuck".