zoukankan      html  css  js  c++  java
  • What is the difference between arguments and parameters?

    What is the difference between arguments and parameters?

    Parameters are defined by the names that appear in a function definition, whereas arguments are the values actually passed to a function when calling it. Parameters define what types of arguments a function can accept. For example, given the function definition:

    def func(foo, bar=None, **kwargs):
        pass
    

    foo, bar and kwargs are parameters of func. However, when calling func, for example:

    func(42, bar=314, extra=somevar)
    

    the values 42, 314, and somevar are arguments.

  • 相关阅读:
    Numpy
    啊大大阿达
    asda
    啊大大
    初识python
    初识python
    初识python
    初识python
    初识python
    初识python
  • 原文地址:https://www.cnblogs.com/weaming/p/5053471.html
Copyright © 2011-2022 走看看