Can I use the variable name “type” as function argument in Python?

前端 未结 5 1511
别那么骄傲
别那么骄傲 2020-12-07 00:44

Can I use type as a name for a python function argument?

def fun(name, type):
    ....
5条回答
  •  北荒
    北荒 (楼主)
    2020-12-07 01:12

    You can, but you would be masking the built-in name type. So it's better not to do that.

提交回复
热议问题