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

    Mar 21, 2023 · 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 …

  2. Is there a "not equal" operator in Python? - Stack Overflow

    Jun 16, 2012 · There are two operators in Python for the "not equal" condition - a.) != If values of the two operands are not equal, then the condition becomes true. (a != b) is true.

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

  4. python - `from ... import` vs `import .` - Stack Overflow

    Feb 25, 2012 · I'm wondering if there's any difference between the code fragment from urllib import request and the fragment import urllib.request or if they are interchangeable. If they are …

  5. 'Python not found' despite having been installed [duplicate]

    Feb 28, 2021 · The Python application path, which is the folder where you originally installed Python; and The Python Scripts path. The Scripts folder should be located within the Python …

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

    Jul 21, 2010 · Why is it 'better' to use my_dict.keys() over iterating directly over the dictionary? Iteration over a dictionary is clearly documented as yielding keys. It appears you had Python 2 …

  7. Python command not working in command prompt [duplicate]

    When I type python into the command line, the command prompt says python is not recognized as an internal or external command, operable program, or batch file. What should I do? Note: I …

  8. python - How do I check if a variable exists? - Stack Overflow

    May 9, 2009 · I want to check if a variable exists. Now I'm doing something like this: try: myVar except NameError: # Do something. Are there other ways without exceptions?

  9. python - Extracting extension from filename - Stack Overflow

    Nov 23, 2019 · The standard Python function naming convention is really annoying - almost every time I re-look this up, I mistake it as being splittext. If they would just do anything to signify the …

  10. python - 'pip' is not recognized - Stack Overflow

    Apr 25, 2016 · Step 3 - Press Modify Step 4 - Select pip Step 5 - Select Add Python to environment variables and install everything This will install pip and add both, Python and pip …