77
Python f-string quiz
(fstrings.wtf)
Welcome to the Python community on the programming.dev Lemmy instance!
Past
November 2023
October 2023
July 2023
August 2023
September 2023
Walrus operator does an inline assignment to a variable and resolves to the value assigned. If it is in a condition statement, like "if x := y:", it assigns the value of y to x then interprets the expression of the condition as of it just said "if x:". Functionally, that means the assignment happens regardless of the value of y, but the condition only passes if the value of y is "truthy", i.e. if it's not None, an empty collection, numerically equal to zero, or just False.