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

    In Python this is simply =. To translate this pseudocode into Python you would need to know the data structures being referenced, and a bit more of the algorithm implementation. Some notes …

  2. math - `/` vs `//` for division in Python - Stack Overflow

    Aug 23, 2024 · In Python 2.2 or later in the 2.x line, there is no difference for integers unless you perform a from __future__ import division, which causes Python 2.x to adopt the 3.x behavior. …

  3. Using or in if statement (Python) - Stack Overflow

    The left part may be false, but right part is true (python has "truth-y" and "fals-y" values), so the check always succeeds. The way to write what you meant to would be. if weather == "Good!" …

  4. python - Iterating over dictionaries using 'for' loops - Stack Overflow

    Jul 21, 2010 · In Python 3.x, iteritems() was replaced with simply items(), which returns a set-like view backed by the dict, like iteritems() but even better. This is also available in 2.7 as …

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

    Apr 25, 2017 · It's an operator in Python that can mean several things depending on the context. A lot of what follows was already mentioned (or hinted at) in the other answers but I thought it …

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

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

  8. python - Pythonic way to combine for-loop and if-statement

    @KirillTitov Yes python is a fundamentally non-functional language (this is a purely imperative coding - and I agree with this answer's author that it is the way python is set up to be written. …

  9. syntax - Python integer incrementing with - Stack Overflow

    Simply put, the ++ and --operators don't exist in Python because they wouldn't be operators, they would have to be statements. All namespace modification in Python is a statement, for …

  10. Does Python have a ternary conditional operator?

    Dec 27, 2008 · At first, the Python's benevolent dictator for life (I mean Guido van Rossum, of course) rejected it (as non-Pythonic style), since it's quite hard to understand for people not …

Refresh