About 149,000 results
Open links in new tab
  1. What does colon equal (:=) in Python mean? - Stack Overflow

    156 This symbol := is an assignment operator in Python (mostly called as the Walrus Operator). In a nutshell, the walrus operator compresses our code to make it a little shorter. Here's a very …

  2. python - What are assignment expressions (using the "walrus" or ...

    117 Since Python 3.8, code can use the so-called "walrus" operator (:=), documented in PEP 572, for assignment expressions. This seems like a really substantial new feature, since it allows …

  3. python - How can I do assignments in a list comprehension

    Apr 24, 2012 · Python 3.8 will introduce Assignment Expressions. It is a new symbol: := that allows assignment in (among other things) comprehensions. This new operator is also known …

  4. Is it possible to overload Python assignment? - Stack Overflow

    Jun 14, 2012 · Assignment to a name is a fundamental feature of Python and no hooks have been provided to change its behavior. However, assignment to a member in a class instance can be …

  5. What do the symbols "=" and "==" mean in python? When is each …

    3 The simple answer is = is an assignment operator, == is a comparison operator. And you are wrong in saying that == can be used in any situation when = works. For example if I wanted to …

  6. operators - What does ":=" do? - Stack Overflow

    Mar 17, 2011 · 3 In Python: Named Expressions (NAME := expr) was introduced in Python 3.8. It allows for the assignment of variables within an expression that is currently being evaluated. …

  7. python - The differences' between the operator "==" and "="

    In python and other languages like C, "=" is a assignment operator and is used to assign a value to a variable. Example: a=2 # the value of a is 2 whereas "==" is Comparison operator and is …

  8. Conditional/ternary operator for expressions in Python

    Many languages have a conditional (AKA ternary) operator. This allows you to make terse choices between two values based on a condition, which makes expressions, including assignments, …

  9. coding style - Assignment with "or" in python - Stack Overflow

    Jan 6, 2012 · Is it considered bad style to assign values to variables like this? x = "foobar" or None y = some_variable or None In the above example, x gets the value 'foobar'.

  10. python - What exactly does += do? - Stack Overflow

    What exactly do we mean by "storing the result in a"? python variables don't store values directly they store references to objects. In python the answers to both of these questions depend on …