📜  在 python 类中使用 kwargs 和 args - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:29.990000             🧑  作者: Mango

代码示例1
def myFun(*args,**kwargs): 
    print("args: ", args) 
    print("kwargs: ", kwargs) 
    
myFun('my','name','is Maheep',firstname="Maheep",lastname="Chaudhary")

# *args - take the any number of argument as values from the user 
# **kwargs - take any number of arguments as key as keywords with 
# value associated with them