About 376,000 results
Open links in new tab
  1. What does -> 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 …

  2. What is a DEF function for Python - Stack Overflow

    Sep 10, 2013 · I am new to coding Python and I just can't seem to understand what a Def function is! I have looked and read many tutorials on it and I still don't quite understand. Can somebody …

  3. What does asterisk * mean in Python? - Stack Overflow

    What does the asterisk mean when there is no argument name? For example in some functions of the class pprint.

  4. python - Why use def main ()? - Stack Overflow

    Oct 28, 2010 · It will be possible to import that python code as a module without nasty side-effects. This means it will be possible to run tests against that code. This means we can import …

  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 - Why do some functions have underscores "__" before …

    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 …

  7. python - What does def main () -> None do? - Stack Overflow

    It is a type annotation for the main function that simply states that this function returns None. Type annotations were introduced in Python 3.5 and are specified in PEP 484. Annotations for the …

  8. python - What is the purpose of the `self` parameter? Why is it …

    811 The reason you need to use self is because Python does not use special syntax to refer to instance attributes. Python decided to do methods in a way that makes the instance to which …

  9. python - What do *args and **kwargs mean? - Stack Overflow

    What exactly do *args and **kwargs mean? According to the Python documentation, from what it seems, it passes in a tuple of arguments. def foo (hello, *args): print (hello) for each in args:...

  10. python - Meaning of a function "-> str" - Stack Overflow

    2 This question already has answers here: What does -> mean in Python function definitions? (12 answers)