About 678,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. 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: …

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

  4. operators - Python != operation vs "is not" - Stack Overflow

    In a comment on this question, I saw a statement that recommended using result is not None vs result != None What is the difference? And why might one be recommended over the other?

  5. Does Python have a ternary conditional operator?

    Dec 27, 2008 · 214 From the documentation: Conditional expressions (sometimes called a “ternary operator”) have the lowest priority of all Python operations. The expression x if C else …

  6. Newest 'python' Questions - Stack Overflow

    6 days ago · Python is an interpreted, interactive, object-oriented (using classes), dynamic and strongly typed programming language that is used for a wide range of applications.

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

  8. python - Extracting extension from filename - Stack Overflow

    Nov 23, 2019 · 12 Extracting extension from filename in Python Python os module splitext () splitext () function splits the file path into a tuple having two values – root and extension.

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

  10. python - How to set the current working directory? - Stack Overflow

    Oct 25, 2017 · import os os.chdir(path) Change the current working directory to path. Availability: Unix, Windows.