About 11,000,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. What does -> mean in Python function definitions? - Stack Overflow

    Jan 17, 2013 · 13 def f(x) -> 123: return x My summary: Simply -> is introduced to get developers to optionally specify the return type of the function. See Python Enhancement Proposal 3107 …

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

  4. How can I use a global variable in a function? - Stack Overflow

    Jul 11, 2016 · How do I create or use a global variable inside a function? How do I use a global variable that was defined in one function inside other functions? Failing to use the global …

  5. 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() …

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

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

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

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

    15 In python, we start defining a function with def, and generally - but not necessarily - end the function with return. Suppose we want a function that adds 2 to the input value x. In …

  10. What does the "at" (@) symbol do in Python? - Stack Overflow

    What does the @ symbol do in Python?What's the syntactic or practical benefit of having decorators here, instead of (for example) just calling something like app.route("/", hello) …