About 7,670,000 results
Open links in new tab
  1. Basic explanation of python functions - Stack Overflow

    Sep 5, 2015 · The Python language, like many others, already has a set of built-in functionality. The function named print is an example of this. You can get a lot of information using the …

  2. python - Why do some functions have underscores - Stack Overflow

    May 24, 2024 · In Python, the use of an underscore in a function name indicates that the function is intended for internal use and should not be called directly by users. It is a convention used …

  3. What is the naming convention in Python for variables and …

    See Python PEP 8: Function and Variable Names: Function names should be lowercase, with words separated by underscores as necessary to improve readability. Variable names follow …

  4. How do I measure elapsed time in Python? - Stack Overflow

    The python cProfile and pstats modules offer great support for measuring time elapsed in certain functions without having to add any code around the existing functions.

  5. python - What do * (single star) and / (slash) do as independent ...

    Jan 9, 2020 · The function parameter syntax (/) is to indicate that some function parameters must be specified positionally and cannot be used as keyword arguments. (This is new in Python …

  6. python - How do I get ("return") a result (output) from a function?

    We can make a tuple right on the return line; or we can use a dictionary, a namedtuple (Python 2.6+), a types.simpleNamespace (Python 3.3+), a dataclass (Python 3.7+), or some other …

  7. python - How do I define a function with optional arguments?

    0 A Python function can take in some arguments, take this for example, def add(x,y): return x+ y # calling this will require only x and y add(2,3) # 5 If we want to add as many arguments as we …

  8. python - What does ** (double star/asterisk) and * (star/asterisk) …

    Aug 31, 2008 · 218 What does (double star) and (star) do for parameters? They allow for functions to be defined to accept and for users to pass any number of arguments, positional (*) …

  9. python - How to run functions in parallel? - Stack Overflow

    I am trying to run multiple functions in parallel in Python. I have something like this: files.py import common #common is a util class that handles all the IO stuff dir1 = 'C:\\folder1' dir2 = 'C:\\

  10. python - How can I call a function within a class? - Stack Overflow

    I have this code which calculates the distance between two coordinates. The two functions are both within the same class. However, how do I call the function distToPoint in the function …