About 6,210,000 results
Open links in new tab
  1. What does -> mean in Python function definitions? - Stack Overflow

    Jan 17, 2013 · def foo() -> lambda hi: True: "function body" # not a type expressions Beside the first the others have no typing meaning; but it still is valid syntax to hide a lambda definition in …

  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. function - what is "def" in Java class - Stack Overflow

    Jan 14, 2021 · while googling, I find that "def" is used in python and groovy language. But, I am using java. So, how come it is possible to use keywords like "def" in java class? Is it possible …

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

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

    Oct 9, 2008 · Using the def keyword in larger programs is important as it helps define the scope in which the variable can be found and can help preserve encapsulation. If you define a method …

  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. How can I use `def` in Jenkins Pipeline? - Stack Overflow

    Nov 10, 2017 · I am learning Jenkins Pipeline, and I tried to follow this Pipeline code. But my Jenkins always complains that def is not legal. I am wondering did I miss any plugins? I …

  10. How do you use input function along with def function?

    Jun 9, 2015 · I'm new to programming. I have a bit of problem with python coding (with def function). So basically the code has to give the smaller number out of 2 numbers. Question: …