icon
Published on

Effective Python › Prevent Repetition with Assignment Expressions

Authors

Content

Effective Python › Item 10: Prevent Repetition with Assignment Expressions

https://effectivepython.com/2020/02/02/prevent-repetition-with-assignment-expressions

  • https://effectivepython.com/2020/02/02/prevent-repetition-with-assignment-expressions
  • Effective Python › Item 10: Prevent Repetition with Assignment Expressions
  • An assignment expression—also known as the walrus operator—is a new syntax introduced in Python 3.8 to solve a long-standing problem with the language that can cause code duplication. Whereas normal assignment statements are written a = b and pronounced “a equals b”, these assignments are written a := b and pronounced “a walrus b” (because := looks like a pair of eyeballs and tusks).