About 8,410,000 results
Open links in new tab
  1. 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 · 14 def isn't a function, it defines a function, and is one of the basic keywords in Python. For example:

  3. Why do we use __init__ in Python classes? - Stack Overflow

    Classes in Python make up of collections of different data, that behave similarly. Class of dogs consists of Fido and Spot and 199999999998 other animals similar to them, all of them peeing …

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

    Suppose I have a function like: def foo(): x = 'hello world' How do I get the function to return x, in such a way that I can use it as the input for another function or use the variable within...

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

    For a language-agnostic consideration of the design decision, see What is the advantage of having this/self pointer mandatory explicit?. To close debugging questions where OP omitted a …

  6. oop - What do __init__ and self do in Python? - Stack Overflow

    Jul 8, 2017 · We could use any other legal Python name, but you will likely get tarred and feathered by other Python programmers if you change it to something else. __init__ is a …

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

  8. python - How to use a variable defined inside one function from …

    The simplest option is to use a global variable. Then create a function that gets the current word. Notice that to read global variables inside a function, you do not need to use the global …

  9. python calling a def () inside of def () - Stack Overflow

    Aug 1, 2018 · I'm making a package for my python assistant and have found a problem. Im importing the following program into the main script. import os def load () : def tts (name) : …

  10. python - How to stop a function - Stack Overflow

    I forgot to add 1 function (main) in the question, but I still have a problem, like others said return returns to a function that called the 2nd function (the one with return statement) so it will never …