About 4,450,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. 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 …

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

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

  5. How to put a define inside a define function - Stack Overflow

    Apr 3, 2015 · In case def move(): def left(): i.e. If there is only one function inside a function it is feasible to return left() from move function. However in this case there are multiple functions …

  6. When does `def` run in python? When will function object be …

    Mar 15, 2017 · -1 def is executed whenever you hit it in parsing the source file. It defines the function. This means that the body of the function is assigned to the name, the parameters are …

  7. What is the purpose of the `self` parameter? Why is it needed?

    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 …

  8. How to determine whether a year is a leap year? - Stack Overflow

    Jul 24, 2012 · I am trying to make a simple calculator to determine whether or not a certain year is a leap year. By definition, a leap year is divisible by four, but not by one hundred, unless it is …

  9. How do I define a function with optional arguments?

    I have a Python function which takes several arguments. Some of these arguments could be omitted in some scenarios. def some_function (self, a, b, c, d = None, e ...

  10. python - Differences between `class` and `def` - Stack Overflow

    What is the main difference between class and def in python? Can a class in python interact with django UI (buttons)?

Refresh