主页
Python
Python 函数参数
demo_function_arg_pos_only3
运行 ❯
×
更改方向
保存代码
更改主题
def my_function(name, /): print("Hello", name) #This will cause an error: my_function(name = "Emil")
Traceback (most recent call last):
File "./prog.py", line 5, in <module>
TypeError: my_function() got some positional-only arguments passed as keyword arguments: 'name'