About 356,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 allowing you to …

  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 explain to …

  3. 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 that code into an …

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

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

  6. 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 3.8) …

  7. python - How to use "pass" statement? - Stack Overflow

    The pass statement in Python is used when a statement is required syntactically, but you do not want any command or code to execute. The pass statement is a null operation; nothing happens when it …

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

  9. python - What is the purpose of the `self` parameter? Why is it needed ...

    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 the method …

  10. python - Why do some functions have underscores "__" before and …

    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 to indicate …