About 922,000 results
Open links in new tab
  1. python - What does the caret (^) operator do? - Stack Overflow

    Dec 14, 2021 · Also, a ^= b is equivalent to a = a.__ixor__(b) (where __xor__ is used as a fallback when __ixor__ is implicitly called via using ^= but does not exist). In principle, what __xor__ …

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

    Jan 30, 2011 · In Python, += is sugar coating for the __iadd__ special method, or __add__ or __radd__ if __iadd__ isn't present. The __iadd__ method of a class can do anything it wants. …

  3. What does colon equal (:=) in Python mean? - Stack Overflow

    Mar 21, 2023 · The code in the question is pseudo-code; there, := represents assignment. For future visitors, though, the following might be more relevant: the next version of Python (3.8) …

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

    Jun 17, 2011 · I also do not know what to search for as searching Python docs or Google does not return relevant results when the @ symbol is included. If you want to have a rather …

  5. What does the percentage sign mean in Python [duplicate]

    Apr 25, 2017 · However, the string formatting behavior is supplemented as of Python 3.1 in favor of the string.format() mechanism: The formatting operations described here exhibit a variety of …

  6. What does -> mean in Python function definitions? - Stack Overflow

    Jan 17, 2013 · In Python 3.5 though, PEP 484 -- Type Hints attaches a single meaning to this: -> is used to indicate the type that the function returns. It also seems like this will be enforced in …

  7. python - What is the purpose of the -m switch? - Stack Overflow

    You must run python my_script.py from the directory where the file is located. Alternatively - python path/to/my_script.py. However, you can run python -m my_script (ie refer to the script …

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

    See Function Definitions in the Language Reference.. If the form *identifier is present, it is initialized to a tuple receiving any excess positional parameters, defaulting to the empty tuple.

  9. python - How to emulate a do-while loop? - Stack Overflow

    S. Lott: I'm pretty sure his question was about how to implement do while in python. So, I wouldn't expect his code to be completely correct. So, I wouldn't expect his code to be completely …

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

    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 …

Refresh