About 698,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. python - Importing files from different folder - Stack Overflow

    I have this folder structure: application ├── app │ └── folder │ └── file.py └── app2 └── some_folder └── some_file.py How can I import a function from file.py, from within som...

  3. python - How do I check whether a file exists without exceptions ...

    How do I check whether a file exists or not, without using the try statement?

  4. python - How can I add new keys to a dictionary? - Stack Overflow

    How do I add a new key to an existing dictionary? It doesn't have an .add () method.

  5. python - How do I terminate a script? - Stack Overflow

    also sys.exit () will terminate all python scripts, but quit () only terminates the script which spawned it. David C. Over a year ago Do you know if this command works differently in python …

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

    An @ symbol at the beginning of a line is used for class and function decorators: PEP 318: Decorators Python Decorators - Python Wiki The most common Python decorators are: …

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

  8. python - How do I access command line arguments? - Stack …

    I highly recommend argparse which comes with Python 2.7 and later. The argparse module reduces boiler plate code and makes your code more robust, because the module handles all …

  9. python - Count the number of occurrences of a character in a …

    How do I count the number of occurrences of a character in a string? e.g. 'a' appears in 'Mary had a little lamb' 4 times.

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