Old #Python: n = len(data); if n > 10: ... New Python: if (n := len(data)) > 10: ... The walrus operator (3.8) assigns and tests in one expression — handy in "if" and "while" conditions, and in comprehensions.
5 likes 1 replies
?
Old #Python: n = len(data); if n > 10: ... New Python: if (n := len(data)) > 10: ... The walrus operator (3.8) assigns and tests in one expression — handy in "if" and "while" conditions, and in comprehensions.
5 likes 1 replies