Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to implement "positional-only parameter" in a user defined function?

def fun( a, b, /): 
    print(a,b)

o/p:

File "<ipython-input-36-1fceb840aeb9>", line 1 def fun( a, b, /): ^ SyntaxError: invalid syntax

How to implement "positional-only parameter" in a user defined function?

def fun( a, b, /): print(a,b)

print(a,b)

o/p:

File "<ipython-input-36-1fceb840aeb9>", line 1 def fun( a, b, /): ^ SyntaxError: invalid syntax