About 892,000 results
Open links in new tab
  1. What does the "at" (@) symbol do in Python? - Stack Overflow

    Jun 17, 2011 · 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 …

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

    What can I do in order to catch the 'stop iteration' exception and break a while loop properly? You could do it as shown below and which also makes use of the assignment expressions feature …

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

    TypeError: unsupported operand type(s) for ^: 'float' and 'int' One neat thing about Python is that you can override this behavior in a class of your own. For example, in some languages the ^ …

  4. python - What does if __name__ == "__main__": do? - Stack Overflow

    Jan 7, 2009 · If you are trying to close a question where someone should be using this idiom and isn't, consider closing as a duplicate of Why is Python running my module when I import it, and …

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

  6. What does the 'with' statement do in python? - Stack Overflow

    Sep 13, 2013 · I am new to Python. In one tutorial of connecting to mysql and fetching data, I saw the with statement. I read about it and it was something related to try-finally block. But I …

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

    What exactly do we mean by "adding"? 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 …

  8. syntax - What does __all__ mean in Python? - Stack Overflow

    Explain all in Python? I keep seeing the variable __all__ set in different __init__.py files. What does this do? What does __all__ do? It declares the semantically "public" names from a …

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

    Jan 17, 2013 · In more detail, Python 2.x has docstrings, which allow you to attach a metadata string to various types of object. This is amazingly handy, so Python 3 extends the feature by …

  10. What does the "yield" keyword do in Python? - Stack Overflow

    Oct 24, 2008 · Then each time you extract an object from the generator, Python executes code in the function until it comes to a yield statement, then pauses and delivers the object. When you …