About 451,000 results
Open links in new tab
  1. python - How do I define a function with optional arguments? - Stack ...

    The arguments d through h are strings which each have different meanings. It is important that I can choose which optional parameters to pass in any combination.

  2. python - What does ** (double star/asterisk) and * (star/asterisk) do ...

    Aug 31, 2008 · Note: A Python dict, semantically used for keyword argument passing, is arbitrarily ordered. However, in Python 3.6+, keyword arguments are guaranteed to remember insertion order. …

  3. python - Pass a list to a function to act as multiple arguments - Stack ...

    function_that_needs_strings(*my_list) where my_list can be any iterable; Python will loop over the given object and use each element as a separate argument to the function.

  4. python - Normal arguments vs. keyword arguments - Stack Overflow

    Sep 13, 2009 · You have to mention them after all of the arguments without names (positional arguments), and there must be default values for any parameters which were not mentioned at all. …

  5. Passing functions with arguments to another function in Python?

    Is it possible to pass functions with arguments to another function in Python? Say for something like: def perform (function): return function () But the functions to be passed will have argume...

  6. python - What do * (single star) and / (slash) do as independent ...

    Jan 9, 2020 · The function parameter syntax (/) is to indicate that some function parameters must be specified positionally and cannot be used as keyword arguments. (This is new in Python 3.8) …

  7. Function arguments (in Python for example) - Stack Overflow

    Aug 17, 2011 · What are [function] arguments? What are they used for? I started learning Python very recently; I'm new to programming and I apologize for this basic question. In every Python tutorial I go …

  8. python - How to do multiple arguments to map function where one …

    Let's say we have a function add as follows def add(x, y): return x + y we want to apply map function for an array map(add, [1, 2, 3], 2) The semantics are I want to add 2 to every element of...

  9. python - Why can a function modify some arguments as perceived by …

    Some answers contain the word "copy" in the context of a function call. I find it confusing. Python doesn't copy objects you pass during a function call ever. Function parameters are names. When you call a …

  10. Python - use list as function parameters - Stack Overflow

    Python - use list as function parameters [duplicate] Asked 14 years, 10 months ago Modified 6 years, 2 months ago Viewed 221k times