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

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

    As is, it does absolutely nothing. 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 …

  3. How can I return two values from a function in Python?

    I would like to return two values from a function in two separate variables. What would you expect it to look like on the calling end? You can't write a = select_choice(); b = select_choice() …

  4. .def files C/C++ DLLs - Stack Overflow

    Jul 21, 2014 · The advantage of def file is that, it helps you to maintain the backword compatibility with the already realsed dlls. i.e it maintains the ordinal numbers for apis. Suppose you add a …

  5. How do I get ("return") a result (output) from a function? How can …

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

  6. Groovy: what's the purpose of "def" in "def x = 0"?

    Oct 9, 2008 · However, variables defined using the keyword "def" are treated as local variables, that is, local to this one script. Variables without the "def" in front of them are stored in a so …

  7. What is the difference between "def" and "val" to define a function

    Sep 19, 2013 · def can be used to define a method, and this is fastest option. @A.Karimi For fun: on 2.12, even eq even. @animageofmine Scala compiler can try to inline methods. There is …

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

    May 24, 2024 · The other respondents are correct in describing the double leading and trailing underscores as a naming convention for "special" or "magic" methods. While you can call …

  9. python - What is the purpose of the return statement? How is it ...

    def f(x): return x + 2 That is: we def ine a function named f, which will be given an x value. When the code runs we figure out x + 2, and return that value. Instead of describing a relationship, …

  10. Is the `def` keyword optional? If so, why use it? - Stack Overflow

    Mar 18, 2020 · I have noticed that this is extendable to all code - anytime you want to define a variable and set its value, eg var = 2 the def keyword can be safely left out. It only appears to …