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

    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__ does is …

  2. 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 …

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

    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) will gain a new …

  4. 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 …

  5. 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 …

  6. What does 'is' operator do in Python? - Stack Overflow

    Aug 16, 2013 · Python tries to emulate the English language syntax to make it more human readable, but in this instance the operator precedence is a little confusing. >>> val is not None …

  7. What does [:-1] mean/do in python? - Stack Overflow

    Mar 20, 2013 · Working on a python assignment and was curious as to what [:-1] means in the context of the following code: instructions = f.readline()[:-1] Have searched on here on S.O. …

  8. python - What does ** (double star/asterisk) and * (star/asterisk) …

    Aug 31, 2008 · The function recieving the parameters does not have to know that they are being expanded. For example, Python 2's xrange does not explicitly expect *args, but since it takes …

  9. 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 …

  10. oop - What do __init__ and self do in Python? - Stack Overflow

    Jul 8, 2017 · Most object-oriented languages pass this as a hidden parameter to the methods defined on an object; Python does not. You have to declare it explicitly. When you create an …