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

    Mar 21, 2023 · What does the := operand mean, more specifically for Python? Can someone explain how to read this snippet of code? node := root, cost = 0 frontier := priority queue containing node …

  2. What does the "at" (@) symbol do in Python? - Stack Overflow

    96 What does the “at” (@) symbol do in Python? @ symbol is a syntactic sugar python provides to utilize decorator, to paraphrase the question, It's exactly about what does decorator do in Python? Put it …

  3. syntax - What do >> and << mean in Python? - Stack Overflow

    Apr 3, 2014 · The other case involving print >>obj, "Hello World" is the "print chevron" syntax for the print statement in Python 2 (removed in Python 3, replaced by the file argument of the print() function).

  4. What is the reason for having '//' in Python? [duplicate]

    Oct 8, 2009 · In Python 3, they made the / operator do a floating-point division, and added the // operator to do integer division (i.e., quotient without remainder); whereas in Python 2, the / operator was …

  5. python - What does the caret (^) operator do? - Stack Overflow

    Side note, seeing as Python defines this as an xor operation and the method name has "xor" in it, I would consider it a poor design choice to make that method do something not related to xor like …

  6. What does asterisk * mean in Python? - Stack Overflow

    107 All of the above answers were perfectly clear and complete, but just for the record I'd like to confirm that the meaning of * and ** in python has absolutely no similarity with the meaning of similar-looking …

  7. What does the ** maths operator do in Python? - Stack Overflow

    58 It is the power operator. From the Python 3 docs: The power operator has the same semantics as the built-in pow () function, when called with two arguments: it yields its left argument raised to the power …

  8. What is the result of % (modulo operator / percent sign) in Python?

    This is because in JavaScript % is the "remainder" operator while in Python it is the "modulus" (clock math) operator. You can get the explanation directly from GvR: Edit - dahiya_boy In Java and iOS …

  9. 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 this form of …

  10. What does the power operator (**) in Python translate into?

    Jan 12, 2022 · 1 The ** operator will, internally, use an iterative function (same semantics as built-in pow() (Python docs), which likely means it just calls that function anyway). Therefore, if you know the …