News Score: Score the News, Sort the News, Rewrite the Headlines

New Python Operators! - Better Programming

Walrus Operator :=The new “walrus operator” in Python 3.8, written as :=, has been much discussed. This post introduces additional whimsically-named multi-character operators. They are available as of today, April 1, 2023, and amazingly, they work even in Python versions that were frozen before these operators were invented!Ski Hat OperatorThe “ski hat” operator, written as *=0, can be used to empty out a variable, be it a list, string, tuple, or numeric value.For example, after executing the fo...

Read more at betterprogramming.pub

© News Score  score the news, sort the news, rewrite the headlines