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

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

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

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

  6. python - Why use def main ()? - Stack Overflow

    Oct 28, 2010 · Variables inside def main are local, while those outside it are global. This may introduce a few bugs and unexpected behaviors. But, you are not required to write a main() …

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

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

  9. How to use the def function in IF or ELSE/ ELIF satement in python?

    Jan 3, 2016 · Yes you can but you have to do it right and add conditions after elif. Python programming references typically explain the syntax of if else elif very well and many other …

  10. How can I change a global variable from within a function?

    Like this: def test(): global a a = a + 10 print(a) Using the global keyword just tells the test where to look for a. With the first method, you can't modify the global variable a, because you made a …