About 51 results
Open links in new tab
  1. What does -> mean in Python function definitions?

    Jan 17, 2013 · 744 It's a function annotation. In more detail, Python 2.x has docstrings, which allow you to attach a metadata string to various types of object. This is amazingly handy, so Python 3 extends …

  2. python - How to stop a function - Stack Overflow

    A simple return statement will 'stop' or return the function; in precise terms, it 'returns' function execution to the point at which the function was called - the function is terminated without further action.

  3. What is a DEF function for Python - Stack Overflow

    Sep 10, 2013 · 14 def isn't a function, it defines a function, and is one of the basic keywords in Python. For example:

  4. Python: defining a function inside of a function - Stack Overflow

    To be more general, they "do something" with the passed in method/function. That my include calling it and return its result, iterating over it and returning the resulting joined string, or, as you said, …

  5. How do Python functions handle the types of parameters that you pass …

    Apr 7, 2017 · def my_func(param1, param2): # stuff However, you don't actually give the types of those parameters. Also, if I remember, Python is a strongly typed language, as such, it seems like Python …

  6. python - How do I define a function with optional arguments? - Stack ...

    See the Python documentation for an excellent summary; the various other answers to the question make use of most of these variations. Since you always have parameters a, b, c in your example and …

  7. How do I execute an def in python from input - Stack Overflow

    Oct 8, 2014 · available_functions[d]() Outputs: Enter the def name: function In function Define your available functions in a dictionary. You can use this to determine if such a function exists. Then, you …

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

    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 in PEP 484. Annotations for the return …

  9. How does Python know where the end of a function is?

    def f(): pass; pass The three forms above show how the end of a function is defined syntactically. As for the semantics, in Python there are three ways to exit a function: Using the return statement. This …

  10. python - How to use a variable defined inside one function from …

    def oneFunction(lists): category=random.choice(list(lists.keys())) word=random.choice(lists[category]) def anotherFunction(): for letter in word: #problem is here print("_",end=" ") I have previously defined …